forked from eps696/stylegan2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
756bae3
commit ba27ab0
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) 2019, NVIDIA Corporation. All rights reserved. | ||
// | ||
// This work is made available under the Nvidia Source Code License-NC. | ||
// To view a copy of this license, visit | ||
// https://nvlabs.github.io/stylegan2/license.html | ||
|
||
#include <cstdio> | ||
|
||
void checkCudaError(cudaError_t err) | ||
{ | ||
if (err != cudaSuccess) | ||
{ | ||
printf("%s: %s\n", cudaGetErrorName(err), cudaGetErrorString(err)); | ||
exit(1); | ||
} | ||
} | ||
|
||
__global__ void cudaKernel(void) | ||
{ | ||
printf("GPU says hello.\n"); | ||
} | ||
|
||
int main(void) | ||
{ | ||
printf("CPU says hello.\n"); | ||
checkCudaError(cudaLaunchKernel((void*)cudaKernel, 1, 1, NULL, 0, NULL)); | ||
checkCudaError(cudaDeviceSynchronize()); | ||
return 0; | ||
} |