mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 10:33:59 -05:00
7 lines
206 B
Plaintext
7 lines
206 B
Plaintext
// Type your code here, or load an example.
|
|
__global__ void square(int* array, int n) {
|
|
int tid = blockDim.x * blockIdx.x + threadIdx.x;
|
|
if (tid < n)
|
|
array[tid] = array[tid] * array[tid];
|
|
}
|