Skip to content

Commit

Permalink
fix clang compilation error and gcc warnings (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn authored and fwyzard committed Oct 27, 2019
1 parent b2ce037 commit 617f9a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/interface/prefixScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ __global__ void multiBlockPrefixScan(T const* __restrict__ ci, T* __restrict__ c
__shared__ bool isLastBlockDone;
if (0 == threadIdx.x) {
auto value = atomicAdd(pc, 1); // block counter
isLastBlockDone = (value == (gridDim.x - 1));
isLastBlockDone = (value == (int(gridDim.x) - 1));
}

__syncthreads();
Expand All @@ -151,7 +151,7 @@ __global__ void multiBlockPrefixScan(T const* __restrict__ ci, T* __restrict__ c

// let's get the partial sums from each block
__shared__ T psum[1024];
for (int i = threadIdx.x; i < gridDim.x; i += blockDim.x) {
for (int i = threadIdx.x, ni = gridDim.x; i<ni; i += blockDim.x) {
auto j = 1024 * i + 1023;
psum[i] = (j < size) ? co[j] : T(0);
}
Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/test/OneToManyAssoc_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ int main() {

// now the inverse map (actually this is the direct....)
AtomicPairCounter* dc_d;
AtomicPairCounter dc;
AtomicPairCounter dc(0);

#ifdef __CUDACC__
cudaMalloc(&dc_d, sizeof(AtomicPairCounter));
Expand All @@ -246,7 +246,7 @@ int main() {
verifyBulk(a_d.get(), dc_d);
memcpy(&la, a_d.get(), sizeof(Assoc));

AtomicPairCounter sdc;
AtomicPairCounter sdc(0);
fillBulk(&sdc, v_d, sa_d.get(), N);
cudautils::finalizeBulk(&sdc, sa_d.get());
verifyBulk(sa_d.get(), &sdc);
Expand Down

0 comments on commit 617f9a0

Please sign in to comment.