MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / AllocatorPinned

Class AllocatorPinned

src/backend/cuda/memory.hpp:75–84  ·  view source on GitHub ↗

CUDA Pinned Memory does not depend on device So we pass 1 as numDevices to the constructor so that it creates 1 vector of memory_info When allocating and freeing, it doesn't really matter which device is active

Source from the content-addressed store, hash-verified

73// of memory_info
74// When allocating and freeing, it doesn't really matter which device is active
75class AllocatorPinned final : public arrayfire::common::AllocatorInterface {
76 public:
77 AllocatorPinned();
78 ~AllocatorPinned() = default;
79 void shutdown() override;
80 int getActiveDeviceId() override;
81 size_t getMaxMemorySize(int id) override;
82 void *nativeAlloc(const size_t bytes) override;
83 void nativeFree(void *ptr) override;
84};
85
86} // namespace cuda
87} // namespace arrayfire

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected