Код: Выделить всё
subtract_kernel = cp.RawKernel(
"""
extern "C" __global__
void subtract_kernel(float* A, float* B, float* C, const int size)
{
unsigned int tidx = threadIdx.x;
unsigned int idx = blockIdx.x * blockDim.x + tidx;
if(idx
Подробнее здесь: [url]https://stackoverflow.com/questions/79882200/cupy-kernel-template-for-elementwise-reductions[/url]
Мобильная версия