Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/sapporo_light/dev_evaluate_gravity.cu
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ __device__ void body_body_interaction(float &ds_min,

}

float inv_ds = rsqrt(ds2 + EPS2) * (__float_as_int(pos_i.w.y) != __float_as_int(pos_j.w.y));
float inv_ds = 0.0f;
if (__float_as_int(pos_i.w.y) != __float_as_int(pos_j.w.y)) {
inv_ds = rsqrt(ds2 + EPS2);
}

float mass = pos_j.w.x;
float inv_ds2 = inv_ds*inv_ds; // 1 FLOP
float inv_ds3 = mass * inv_ds*inv_ds2; // 2 FLOP
Expand Down
2 changes: 1 addition & 1 deletion lib/sapporo_light/send_fetch_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void sapporo::free_cuda_memory(int ignore) {
CUDA_SAFE_CALL(cudaFree( (void*)dev.ngb_list_i));


CUDA_SAFE_CALL(cudaThreadExit());
CUDA_SAFE_CALL(cudaDeviceReset());
CUT_CHECK_ERROR("Failedn");
}

Expand Down
Loading