funclp.use_cuda module

funclp.use_cuda(instance, out_shape, inputs)[source]

Defines cuda parameters.

Parameters:
  • instance (Function) – function object.

  • out_shape (tuple) – (nmodels, npoints) shape of output.

  • inputs (tuple) – (variables, data, parameters) inputs.

Returns:

  • cuda (bool) – True if dusing cuda.

  • xp (module) – numpy / cupy

  • transfer_back (bool) – True if cuda and all inputs where on CPU –> transfer back to CPU at the end

  • blocks_per_grid (tuple) – blocks per grid for cuda kernel 2D (nmodels, npoints)

  • threads_per_block (tuple) – threads per block for cuda kernel 2D (nmodels, npoints)