Skip to content

Commit 096e0e3

Browse files
makortelfwyzard
authored andcommitted
Include local copy of CachingDeviceAllocator (#240)
1 parent eae2fbc commit 096e0e3

File tree

3 files changed

+721
-14
lines changed

3 files changed

+721
-14
lines changed

HeterogeneousCore/CUDAServices/src/CUDAService.cc

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
#include <cuda.h>
66
#include <cuda/api_wrappers.h>
77

8-
#include <cub/util_allocator.cuh>
9-
108
#include "FWCore/MessageLogger/interface/MessageLogger.h"
119
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
1210
#include "FWCore/ParameterSet/interface/ParameterSet.h"
1311
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
1412
#include "HeterogeneousCore/CUDAServices/interface/CUDAService.h"
1513
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
1614

15+
#include "CachingDeviceAllocator.h"
1716
#include "CachingHostAllocator.h"
1817

1918
void setCudaLimit(cudaLimit limit, const char* name, size_t request) {
@@ -311,7 +310,7 @@ CUDAService::CUDAService(edm::ParameterSet const& config, edm::ActivityRegistry&
311310
<< " max bin " << maxBin << "\n"
312311
<< " resulting bins:\n";
313312
for (auto bin = minBin; bin <= maxBin; ++bin) {
314-
auto binSize = cub::CachingDeviceAllocator::IntPow(binGrowth, bin);
313+
auto binSize = notcub::CachingDeviceAllocator::IntPow(binGrowth, bin);
315314
if (binSize >= (1<<30) and binSize % (1<<30) == 0) {
316315
log << " " << std::setw(8) << (binSize >> 30) << " GB\n";
317316
} else if (binSize >= (1<<20) and binSize % (1<<20) == 0) {
@@ -324,7 +323,7 @@ CUDAService::CUDAService(edm::ParameterSet const& config, edm::ActivityRegistry&
324323
}
325324
log << " maximum amount of cached memory: " << (minCachedBytes >> 20) << " MB\n";
326325

327-
allocator_ = std::make_unique<Allocator>(cub::CachingDeviceAllocator::IntPow(binGrowth, maxBin),
326+
allocator_ = std::make_unique<Allocator>(notcub::CachingDeviceAllocator::IntPow(binGrowth, maxBin),
328327
binGrowth, minBin, maxBin, minCachedBytes,
329328
false, // do not skip cleanup
330329
debug
@@ -427,8 +426,8 @@ struct CUDAService::Allocator {
427426
void hostPreallocate(int numberOfDevices, const std::vector<unsigned int>& bytes);
428427

429428
size_t maxAllocation;
430-
cub::CachingDeviceAllocator deviceAllocator;
431-
cub::CachingHostAllocator hostAllocator;
429+
notcub::CachingDeviceAllocator deviceAllocator;
430+
notcub::CachingHostAllocator hostAllocator;
432431
};
433432

434433
void *CUDAService::allocate_device(int dev, size_t nbytes, cuda::stream_t<>& stream) {

0 commit comments

Comments
 (0)