summaryrefslogtreecommitdiff
path: root/kernel.cu
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@gmail.com>2024-05-09 01:27:55 -0500
committerBrett Weiland <brett_weiland@gmail.com>2024-05-09 01:27:55 -0500
commit51a8923eb33ad53a36271b1e0b3489d033178337 (patch)
tree6c2017a8210f43848e338e6065e0964ee20cf115 /kernel.cu
parent882999e591ece292d5ddbc87020ba70b3d2d1658 (diff)
will push to unison
Diffstat (limited to 'kernel.cu')
-rw-r--r--kernel.cu18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel.cu b/kernel.cu
new file mode 100644
index 0000000..c00056a
--- /dev/null
+++ b/kernel.cu
@@ -0,0 +1,18 @@
+#include <curand.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "include/helper_math.h"
+
+__global__ void test_image(uint8_t *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);
+ size_t img_index = (unnormalized_coordinates.y * img_res.y) + unnormalized_coordinates.x;
+ //uint8_t pixel_val = (img_index / (img_res.x * img_res.y)) * 255;
+ uint8_t pixel_val = 0xff;
+ //if(img_index == 1) printf("%i\n", img_index);
+ print(img_index)
+ image[img_index] = 0xff;
+ image[img_index+1] = pixel_val;
+ image[img_index+2] = pixel_val;
+ image[img_index+3] = 0xff;
+}