You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%%cu
#include <stdio.h>
void helloCPU()
{
printf("Hello from the CPU.\n");
}
/*
* The addition of `__global__` signifies that this function
* should be launced on the GPU.
*/
__global__ void helloGPU()
{
printf("Hello from the GPU.\n");
}
int main()
{
helloCPU();
/*
* Add an execution configuration with the <<<...>>> syntax
* will launch this function as a kernel on the GPU.
*/
helloGPU<<<1, 1>>>();
/*
* `cudaDeviceSynchronize` will block the CPU stream until
* all GPU kernels have completed.
*/
cudaDeviceSynchronize();
}
It runs but I get the output from the CPU but not the GPU
'Hello from the CPU.\n'
The text was updated successfully, but these errors were encountered:
I'm using this code, to prepare the environment
Then when I try to run this simple example:
It runs but I get the output from the CPU but not the GPU
'Hello from the CPU.\n'
The text was updated successfully, but these errors were encountered: