Fork me on GitHub

src/arraymancer/tensor/private/p_kernels_interface_opencl

  Source Edit

Templates

template gen_cl_apply2(kern_name, ctype, op: string): string
Generates an OpenCL kernel for an elementwise in-place binary infix operation (like +=, -=, *.= or /.=) Input:
  • The C type
  • The C kernel name (this only helps debugging the C code)
  • The C operation (+=, -=, *.= or /.=)
  Source Edit
template gen_cl_apply3(kern_name, ctype, op: string): string
Generates an OpenCL kernel for an elementwise binary infix operations (like +, -, ...) Input:
  • The C type
  • The C kernel name (this only helps debugging the C code)
  • The C operation (+, -, ...)
  Source Edit
template genClInfixOp(T: typedesc; ctype: string; procName: untyped;
                      cName: string; cInfixOp: string;
                      exported: static[bool] = true): untyped
Generates binding to an OpenCL kernel for an elementwise binary infix operation (like +, -, ...) Input:
  • The Nim type of the elements of the input tensors
  • The equivalent C type
  • The Nim identifier of the resulting proc
  • The C kernel name (this only helps debugging the C code)
  • The C operation (+, -, ...)
  Source Edit
template genClInPlaceOp(T: typedesc; ctype: string; procName: untyped;
                        cName: string; cInfixOp: string;
                        exported: static[bool] = true): untyped
Generates an OpenCL kernel for an elementwise in-place binary infix operation (like +=, -=, *.= or /.=) Input:
  • The Nim type of the elements of the input tensors
  • The equivalent C type
  • The Nim identifier of the resulting proc
  • The C kernel name (this only helps debugging the C code)
  • The C operation (+=, -=, *.= or /.=)
  Source Edit
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood