Skip to content

Commit 311a5c5

Browse files
committed
Prolly don't merge - possible warning fix but I think it'll break behaviour
1 parent cc68f1e commit 311a5c5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/flamegpu/simulation/detail/CUDAEnvironmentDirectedGraphBuffers.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ void CUDAEnvironmentDirectedGraphBuffers::syncDevice_async(detail::CUDAScatter&
429429
}
430430
{ // Build the map
431431
const auto& v_id_b = vertex_buffers.at(ID_VARIABLE_NAME);
432-
gpuErrchk(cudaMemsetAsync(d_vertex_index_map, 0xffffffff, ID_RANGE * sizeof(unsigned int), stream));
432+
gpuErrchk(cudaMemsetAsync(d_vertex_index_map, INT_MAX, ID_RANGE * sizeof(unsigned int), stream));
433433
gpuErrchk(cudaMemsetAsync(d_pbm_swap, 0, 3 * sizeof(unsigned int), stream)); // We will use spare pbm_swap to count errors, save allocating more memory
434434
const unsigned int BLOCK_SZ = 512;
435435
const unsigned int BLOCK_CT = static_cast<unsigned int>(ceil(vertex_count / static_cast<float>(BLOCK_SZ)));
@@ -478,7 +478,7 @@ void CUDAEnvironmentDirectedGraphBuffers::syncDevice_async(detail::CUDAScatter&
478478
cub_temp.resize(temp_req);
479479
gpuErrchk(cub::DeviceRadixSort::SortPairs(cub_temp.getPtr(), cub_temp.getSize(), d_keys, d_keys_swap, d_vals, d_vals_swap, edge_count, 0, sizeof(uint64_t) * 8, stream));
480480
// Build PBM (For vertices with edges)
481-
gpuErrchk(cudaMemset(d_pbm, 0xffffffff, (vertex_count + 1) * sizeof(unsigned int)));
481+
gpuErrchk(cudaMemset(d_pbm, INT_MAX, (vertex_count + 1) * sizeof(unsigned int)));
482482
gpuErrchk(cudaOccupancyMaxActiveBlocksPerMultiprocessor(&blockSize, findBinStart, 32, 0)); // Randomly 32
483483
gridSize = (edge_count + blockSize - 1) / blockSize; // Round up according to array size
484484
findBinStart << <gridSize, blockSize, 0, stream >> > (d_pbm, d_keys_swap, edge_count, vertex_count);
@@ -532,7 +532,7 @@ void CUDAEnvironmentDirectedGraphBuffers::syncDevice_async(detail::CUDAScatter&
532532
auto& cub_temp = scatter.CubTemp(streamID);
533533
gpuErrchk(cub::DeviceRadixSort::SortPairs(cub_temp.getPtr(), cub_temp.getSize(), d_keys, d_keys_swap, d_vals, d_vals_swap, edge_count, 0, sizeof(uint64_t) * 8, stream));
534534
// Build inverted PBM (For vertices with edges)
535-
gpuErrchk(cudaMemset(d_ipbm, 0xffffffff, (vertex_count + 1) * sizeof(unsigned int)));
535+
gpuErrchk(cudaMemset(d_ipbm, INT_MAX, (vertex_count + 1) * sizeof(unsigned int)));
536536
gpuErrchk(cudaOccupancyMaxActiveBlocksPerMultiprocessor(&blockSize, findBinStart, 32, 0)); // Randomly 32
537537
gridSize = (edge_count + blockSize - 1) / blockSize; // Round up according to array size
538538
findBinStart << <gridSize, blockSize, 0, stream >> > (d_ipbm, d_keys_swap, edge_count, vertex_count);

0 commit comments

Comments
 (0)