Hello! I’m new to Numba Cuda and I’m hoping someone could help me.
Can I use the built-in vector type float3 that exists in Cuda documentation? I know that is possible to use with PyCuda, for example, a kernel like:
addarrs_codetext = """
__global__ void add_3darrs_broadcast(float3 *out, float3 *a, float3 *b, int* SZ)
{
const int M = SZ[0];
const int N = SZ[1];
const int S = SZ[2];
const int tx = threadIdx.x;
const int bx = blockIdx.x;
const int BSZ = blockDim.x;
int t;
for (int s=0;s<S;s++)
{
t = s*BSZ+tx;
if(t<N)
dest[bx*N+t].x = b[t].x + a[bx].x;
dest[bx*N+t].y = b[t].y + a[bx].y;
dest[bx*N+t].z = b[t].z + a[bx].z;
__syncthreads();
}
}
"""
How could I do the same with Numba Cuda?
Thanks!