workspace

This commit is contained in:
Brett Weiland 2024-05-08 22:52:46 -05:00
parent ae190c6202
commit 882999e591
7 changed files with 1523 additions and 0 deletions

14
.gdb_history Normal file
View File

@ -0,0 +1,14 @@
quit
break main.c:11
run
image
print image
print image.data
print image.data[0]
print image.data
x image.data
x *image.data
x *=image.data
print image
context
quit

BIN
bruh Executable file

Binary file not shown.

0
first
View File

1469
include/helper_math.h Normal file

File diff suppressed because it is too large Load Diff

23
main.c Normal file
View File

@ -0,0 +1,23 @@
#include <stdio.h>
#include "raylib.h"
int main() {
const int size_x = 1920;
const int size_y = 1080;
Image image = GenImageColor(size_x, size_y, BLUE);
InitWindow(size_x, size_y, "cuda teseteroni");
if(!IsWindowFullscreen()) ToggleFullscreen();
while(!WindowShouldClose()) {
BeginDrawing();
DrawTexture(LoadTextureFromImage(image), 0, 0, WHITE);
EndDrawing();
}
return 0;
}

6
main.cu Normal file
View File

@ -0,0 +1,6 @@
#include "include/helper_math.h"
__global__ void random_noise(double **image) {
int2 unnormalized_coordinates = make_int2(blockDim.x, blockDim.y) * make_int2(blockIdx.x, blockIdx.y) + make_int2(threadIdx.x, threadIdx.y);
int2 img_res = make_int2(blockDim.x, blockDim.y) * make_int2(gridDim.x, gridDim.y);//could move out of kernel for performance boost
}

11
makefile Normal file
View File

@ -0,0 +1,11 @@
LIBS = -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
$CC = gcc
make:
$(CC) $(LIBS) main.c -o build/main.o
nvcc --compile main.cu -o build/kernel.o
gcc -o indigo_worlds main.o kernel.o
clean:
rm -r build/*