All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.finmath.montecarlo.RandomVariableCudaKernel.cu Maven / Gradle / Ivy

extern "C"
__global__ void capByScalar(int n, float *a, float b, float *result)
{
	float cap = b;
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i floor ? a[i] : floor;
    }
}

extern "C"
__global__ void addScalar(int n, float *a, float b, float *result)
{
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i b[i] ? a[i] : b[i];
    }
}

extern "C"
__global__ void add(int n, float *a, float *b, float *result)
{
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i0; s>>=1) {
		if (tid < s) {
			sdata[tid] += sdata[tid + s];
		}
		__syncthreads();
	}

	// write result for this block to global mem
	if (tid == 0) sum[blockIdx.x] = sdata[0];
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy