docs: add teaching examples and video project
This commit is contained in:
parent
e93bc20b0a
commit
7a06f94577
42 changed files with 8022 additions and 0 deletions
13
show/02_cuda_seed.cuh
Normal file
13
show/02_cuda_seed.cuh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
// CUDA translation of stage 01: one work item is one seed, its positions are serial.
|
||||
__global__ void seedKernel(DeviceArgs a, show::Hit* hits, unsigned long long* count) {
|
||||
const uint64_t stride=uint64_t(gridDim.x)*blockDim.x;
|
||||
for(uint64_t s=uint64_t(blockIdx.x)*blockDim.x+threadIdx.x;s<a.seeds;s+=stride) {
|
||||
for(uint64_t xi=0;xi<a.width;++xi) for(uint64_t zi=0;zi<a.height;++zi) {
|
||||
const int32_t x=int32_t(int64_t(a.x0)+int64_t(xi));
|
||||
const int32_t z=int32_t(int64_t(a.z0)+int64_t(zi));
|
||||
if(show::solid<2>(a.seed+s,x,z,a.n)) emit(a,hits,count,a.seed+s,x,z);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue