BioDynaMo  v1.05.119-a4ff3934
cuda_pinned_memory.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
15 #ifndef CORE_GPU_CUDA_PINNED_MEMORY_H_
16 #define CORE_GPU_CUDA_PINNED_MEMORY_H_
17 
18 #include <cstdint>
19 
20 namespace bdm {
21 
22 #ifdef USE_CUDA
23 
25 template <typename T>
26 void CudaAllocPinned(T** d, uint64_t elements);
27 
28 void CudaFreePinned(void* p);
29 
30 #else
31 
32 template <typename T>
33 inline void CudaAllocPinned(T** d, uint64_t elements) {}
34 
35 inline void CudaFreePinned(void* p) {}
36 
37 #endif // USE_CUDA
38 
39 } // namespace bdm
40 
41 #endif // CORE_GPU_CUDA_PINNED_MEMORY_H_
bdm
Definition: agent.cc:39
bdm::CudaAllocPinned
void CudaAllocPinned(T **d, uint64_t elements)
Definition: cuda_pinned_memory.h:33
bdm::CudaFreePinned
void CudaFreePinned(void *p)
Definition: cuda_pinned_memory.h:35