diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..a36d58b --- /dev/null +++ b/build.bat @@ -0,0 +1,19 @@ +@echo off + +ctime -begin timeBuild.ctm + +@rem /WX /W4 /wd4201 /wd4100 /wd4189 /wd4244 /wd4127 /wd4456 +set CommonCompilerFlags="/nologo /Zi /FC" +set CudaSources=../src/cuda_entry_point.cu +set Sources=../src/main.c + +IF NOT EXIST .\build mkdir .\build +pushd .\build +nvcc -Xcompiler %CommonCompilerFlags% -o program.exe %Sources% %CudaSources% +set LastError=%ERRORLEVEL% +popd + +ctime -end timeBuild.ctm %LastError% +IF NOT %LastError%==0 GOTO :end + +:end diff --git a/src/cuda_entry_point.cu b/src/cuda_entry_point.cu new file mode 100644 index 0000000..517bb6c --- /dev/null +++ b/src/cuda_entry_point.cu @@ -0,0 +1,19 @@ +#include + +#define no_name_mangle extern "C" + + + +__global__ void hello_from_GPU() { + printf("HELLO FROM GPUUUU"); +} + + + +no_name_mangle void cuda_entry_point() { + + hello_from_GPU<<<1, 1>>>(); + + + cudaDeviceSynchronize(); +} diff --git a/src/kernels.h b/src/kernels.h new file mode 100644 index 0000000..b7899cf --- /dev/null +++ b/src/kernels.h @@ -0,0 +1,5 @@ + + + +// Forward declarations +void cuda_entry_point(); diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..c66a48a --- /dev/null +++ b/src/main.c @@ -0,0 +1,17 @@ +#include + +#include "kernels.h" + + + +int main() { + + cuda_entry_point(); + + + printf("hello"); + + + return 0; +} + diff --git a/timeBuild.ctm b/timeBuild.ctm new file mode 100644 index 0000000..b2cd111 Binary files /dev/null and b/timeBuild.ctm differ