Skip to content

Commit

Permalink
creating test file
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonfaaria committed Aug 7, 2020
1 parent 756bae3 commit ba27ab0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test_nvcc.cu
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;
}

0 comments on commit ba27ab0

Please sign in to comment.