Debian Codegraph @

src/thirdparty/Symforce-Caspar/generated/f32/kernel_PinholeFocal_update_step_first.cu

raw
1 #include "kernel_PinholeFocal_update_step_first.h"
2 #include "memops.cuh"
3 #include <cooperative_groups.h>
4 #include <cooperative_groups/details/partitioning.h>
5 #include <cooperative_groups/memcpy_async.h>
6 #include <cooperative_groups/reduce.h>
7 #include <cuda_runtime.h>
8
9 namespace cg = cooperative_groups;
10
11 namespace caspar {
12
13 __global__ void __launch_bounds__(1024, 1) PinholeFocalUpdateStepFirstKernel(
14 float* PinholeFocal_p_kp1,
15 unsigned int PinholeFocal_p_kp1_num_alloc,
16 const float* const alpha,
17 float* out_PinholeFocal_step_kp1,
18 unsigned int out_PinholeFocal_step_kp1_num_alloc,
19 size_t problem_size) {
20 const int global_thread_idx = blockIdx.x * blockDim.x + threadIdx.x;
21 __shared__ uint8_t inout_shared[4096];
22
23 float r0, r1, r2;
24
25 if (global_thread_idx < problem_size) {
26 ReadIdx2<1024, float, float, float2>(PinholeFocal_p_kp1,
27 0 * PinholeFocal_p_kp1_num_alloc,
28 global_thread_idx,
29 r0,
30 r1);
31 };
32 LoadUnique<1, float, float>(alpha, 0, (float*)inout_shared);
33 if (global_thread_idx < problem_size) {
34 ReadShared1<float>((float*)inout_shared, 0, r2);
35 };
36 __syncthreads();
37 if (global_thread_idx < problem_size) {
38 r0 = r0 * r2;
39 r2 = r1 * r2;
40 WriteIdx2<1024, float, float, float2>(
41 out_PinholeFocal_step_kp1,
42 0 * out_PinholeFocal_step_kp1_num_alloc,
43 global_thread_idx,
44 r0,
45 r2);
46 };
47 }
48
49 void PinholeFocalUpdateStepFirst(
50 float* PinholeFocal_p_kp1,
51 unsigned int PinholeFocal_p_kp1_num_alloc,
52 const float* const alpha,
53 float* out_PinholeFocal_step_kp1,
54 unsigned int out_PinholeFocal_step_kp1_num_alloc,
55 size_t problem_size) {
56 if (problem_size == 0) {
57 return;
58 }
59
60 const int n_blocks = (problem_size + 1024 - 1) / 1024;
61 PinholeFocalUpdateStepFirstKernel<<<n_blocks, 1024>>>(
62 PinholeFocal_p_kp1,
63 PinholeFocal_p_kp1_num_alloc,
64 alpha,
65 out_PinholeFocal_step_kp1,
66 out_PinholeFocal_step_kp1_num_alloc,
67 problem_size);
68 }
69
70 } // namespace caspar