12 | __global__ void optimized_cosine_loss_kernel(const float* __restrict__ pred,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | const float* __restrict__ target,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:12:72: note: the first parameter in the range is 'pred'
12 | __global__ void optimized_cosine_loss_kernel(const float* __restrict__ pred,
| ^~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:13:72: note: the last parameter in the range is 'target'
13 | const float* __restrict__ target,
| ^~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:15:46: warning: 2 adjacent parameters of 'optimized_cosine_loss_kernel' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
15 | int N,
| ^~~~~~
16 | int D) {
| ~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:15:50: note: the first parameter in the range is 'N'
15 | int N,
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:16:50: note: the last parameter in the range is 'D'
16 | int D) {
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:17:21: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
17 | const int row = blockIdx.x;
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:18:21: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
18 | const int tid = threadIdx.x;
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:22:62: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t' [bugprone-implicit-widening-of-multiplication-result]
22 | const float4* pred_vec = reinterpret_cast<const float4*>(pred + row*D);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:22:69: note: make conversion explicit to silence this warning
5 | const float4* pred_vec = reinterpret_cast<const float4*>(pred + row*D);
| ^~~~~
| static_cast<ptrdiff_t>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:22:69: note: perform multiplication in a wider type
22 | const float4* pred_vec = reinterpret_cast<const float4*>(pred + row*D);
| ^~~
| static_cast<ptrdiff_t>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:23:64: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t' [bugprone-implicit-widening-of-multiplication-result]
23 | const float4* target_vec = reinterpret_cast<const float4*>(target + row*D);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:23:73: note: make conversion explicit to silence this warning
23 | const float4* target_vec = reinterpret_cast<const float4*>(target + row*D);
| ^~~~~
| static_cast<ptrdiff_t>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:23:73: note: perform multiplication in a wider type
23 | const float4* target_vec = reinterpret_cast<const float4*>(target + row*D);
| ^~~
| static_cast<ptrdiff_t>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:29:39: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
29 | for (int i = tid; i < D_vec; i += blockDim.x) {
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:38:52: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
38 | for (int i = D_vec*vec_size + tid; i < D; i += blockDim.x) {
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:73:68: warning: narrowing conversion from 'int' to 'float' [bugprone-narrowing-conversions]
73 | atomicAdd(output, (1.0f - (dot / fmaxf(denom, eps))) / N);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:78:59: warning: the parameter 'pred' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
78 | torch::Tensor optimized_cosine_loss_forward(torch::Tensor pred, torch::Tensor target) {
| ^
| const &
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:78:79: warning: the parameter 'target' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
78 | torch::Tensor optimized_cosine_loss_forward(torch::Tensor pred, torch::Tensor target) {
| ^
| const &
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:88:9: warning: narrowing conversion from 'int64_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
88 | pred.size(0),
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b10_s2_warp_shfl_shared_opt/base/base.cu:89:9: warning: narrowing conversion from 'int64_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
89 | pred.size(1)
| ^