Export to a CUDA kernel
Only a kernel file is exported, no simulation engine, protocol or post-processing is included.
The standard interface for exporting and accessing expression writers is provided:
Returns a list of all exporters available in this module.
- class myokit.formats.cuda.CudaKernelExporter¶
Exportercreates an unoptimised CUDA cell kernel that calculates a forward Euler step for a single cell.
Only a kernel file is created, no driver class is included and no support for protocol export is provided.
A value must be bound to
diffusion_currentwhich represents the current flowing from cell to cell. This is defined as positive when the cell is acting as a source, negative when it acts like a sink. In other words, it is defined as an outward current.
Please keep in mind that CellML and other downloaded formats are typically not directly suitable for GPU simulation. Specifically, when simulating on single-precision devices a lot of divide-by-zero errors might crop up that remain hidden when using double precision single cell simulations on the CPU.
- class myokit.formats.cuda.CudaKernelRLExporter¶
CudaKernelExporterbut uses a Rush-Larsen update step where applicable.
For this exporter to work, the model’s membrane potential variable must be labelled as
membrane_potential, and a value must be bound to
Returns a list of all expression writers available in this module.
- class myokit.formats.cuda.CudaExpressionWriter(precision=32)¶
Converts an equation to a string
Converts an Expression to a string.
- Sets a naming function, will be called to get the variable name from a
fshould be a function that takes an
LhsExpressionas input and returns a string.