14 | __global__ void coalesced_cosine_similarity_loss_kernel(const float* __restrict__ predictions,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 | const float* __restrict__ targets,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:14:83: note: the first parameter in the range is 'predictions'
14 | __global__ void coalesced_cosine_similarity_loss_kernel(const float* __restrict__ predictions,
| ^~~~~~~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:15:86: note: the last parameter in the range is 'targets'
15 | const float* __restrict__ targets,
| ^~~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:17:60: warning: 2 adjacent parameters of 'coalesced_cosine_similarity_loss_kernel' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
17 | int N,
| ^~~~~~
18 | int D) {
| ~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:17:64: note: the first parameter in the range is 'N'
17 | int N,
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:18:64: note: the last parameter in the range is 'D'
18 | int D) {
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:20:15: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
20 | int row = blockIdx.x;
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:21:15: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
21 | int tid = threadIdx.x;
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:22:21: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
22 | int blockSize = blockDim.x; // Expected to be 512
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:30:69: 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]
30 | const float4* predictions_vec = reinterpret_cast<const float4*>(predictions + row * D);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:30:83: note: make conversion explicit to silence this warning
5 | const float4* predictions_vec = reinterpret_cast<const float4*>(predictions + row * D);
| ^~~~~~~
| static_cast<ptrdiff_t>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:30:83: note: perform multiplication in a wider type
30 | const float4* predictions_vec = reinterpret_cast<const float4*>(predictions + row * D);
| ^~~
| static_cast<ptrdiff_t>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:31:65: 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]
31 | const float4* targets_vec = reinterpret_cast<const float4*>(targets + row * D);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:31:75: note: make conversion explicit to silence this warning
31 | const float4* targets_vec = reinterpret_cast<const float4*>(targets + row * D);
| ^~~~~~~
| static_cast<ptrdiff_t>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:31:75: note: perform multiplication in a wider type
31 | const float4* targets_vec = reinterpret_cast<const float4*>(targets + row * D);
| ^~~
| static_cast<ptrdiff_t>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:95:50: warning: narrowing conversion from 'int' to 'float' [bugprone-narrowing-conversions]
95 | atomicAdd(output, (1.0f - cos_sim) / N);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:100:70: warning: the parameter 'predictions' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
100 | torch::Tensor coalesced_cosine_similarity_loss_forward(torch::Tensor predictions, torch::Tensor targets) {
| ^
| const &
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:100:97: warning: the parameter 'targets' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
100 | torch::Tensor coalesced_cosine_similarity_loss_forward(torch::Tensor predictions, torch::Tensor targets) {
| ^
| const &
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:107:13: warning: narrowing conversion from 'int64_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
107 | int N = predictions.size(0);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250202_optimize_b10_s4_e0_sweep/level_1/task_97/b7_s3_coalesced_cosine_loss_opt/base/base.cu:108:13: warning: narrowing conversion from 'int64_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
108 | int D = predictions.size(1);
| ^