diff options
Diffstat (limited to 'main.cu')
-rw-r--r-- | main.cu | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -3,10 +3,9 @@ #include <cuda_runtime.h> #include <string.h> +#include "kernel.cuh" #include "raylib.h" -__global__ void test_image(uint8_t *image); - int main() { //bluuuuugh i'll figure out occupancy later, this res are easy //calculated manually for gtx1060 with 20 SM, 1024 threads/SM @@ -17,7 +16,8 @@ int main() { uint8_t *image_d; Color texture_data[res_x * res_y]; - + SetTargetFPS(10); + //see if GPU is connected (my egpu is finicky) { @@ -36,16 +36,10 @@ int main() { Image image = GenImageColor(res_x, res_y, BLUE); Texture tex = LoadTextureFromImage(image); - - - - - //if(!IsWindowFullscreen()) ToggleFullscreen(); - while(!WindowShouldClose()) { //cuda stuff cudaMalloc((void **)&image_d, res_x * res_y * sizeof(Color)); - test_image<<<blockCount, threadCount>>>(image_d); + render<<<blockCount, threadCount>>>(image_d); cudaDeviceSynchronize(); cudaMemcpy(texture_data, (void **)image_d, res_x * res_y * sizeof(Color), cudaMemcpyDeviceToHost); |