Imported pyOpenCL library

This commit is contained in:
Jose Luis Cercós pita
2012-07-06 13:51:01 +02:00
parent 6aef063c3c
commit a455cf6fa8
5 changed files with 75 additions and 13 deletions

View File

@@ -25,6 +25,9 @@ import time
from math import *
import threading
# pyOpenCL
import pyopencl as cl
# FreeCAD
import FreeCAD,FreeCADGui
from FreeCAD import Part, Base, Vector
@@ -33,14 +36,20 @@ from FreeCAD import Part, Base, Vector
from shipUtils import Paths, Translator, Math
class FreeCADShipSimulation(threading.Thread):
def __init__ (self, endTime, output, FSmesh, waves):
def __init__ (self, device, endTime, output, FSmesh, waves):
""" Thread constructor.
@param device Device to use.
@param endTime Maximum simulation time.
@param output [Rate,Type] Output rate, Type=0 if FPS, 1 if IPF.
@param FSmesh Free surface mesh faces.
@param waves Waves parameters (A,T,phi,heading)
"""
threading.Thread.__init__(self)
# Build OpenCL context and command queue
self.device = device
self.context = cl.Context(devices=[self.device])
self.queue = cl.CommandQueue(self.context)
# Storage data
self.endTime = endTime
self.output = output
self.FSmesh = FSmesh