From ba27ab0a64d75d8169873b07d90e98f91bee1b9f Mon Sep 17 00:00:00 2001 From: Anderson Faria Date: Fri, 7 Aug 2020 20:19:15 -0300 Subject: [PATCH] creating test file --- test_nvcc.cu | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test_nvcc.cu diff --git a/test_nvcc.cu b/test_nvcc.cu new file mode 100644 index 0000000..8b09bbf --- /dev/null +++ b/test_nvcc.cu @@ -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 + +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; +}