ComputationalPhysiology / gotran

Library for declaring and translating ODEs
http://computationalphysiology.github.io/gotran/
GNU Lesser General Public License v3.0
2 stars 1 forks source link

Improve OpenCL support and add demo #2

Closed KGHustad closed 4 years ago

KGHustad commented 4 years ago

I removed some functions that we generate in the .cu files, since OpenCL (unlike CUDA) does not support host functions in the OpenCL program (the contents of the .cl file).

I put together a very brief demo using pyopencl. It's probably quite slow because the device array is copied back at every timestep, but I was mostly looking to verify correctness.

Note that I disabled the range check in the Python code generated by gotran as this introduced a dependency on modelparameters in the generated code. Not really sure if this feature is used, as it isn't supported in the generated C code.