Skip to content

Commit f4847b7

Browse files
committed
GPU Metal: accept the registration of host memory
The GPU reconstruction workflow registers its shared-memory segments for the GPU, and the Metal backend fell back to the device base, which fails for every GPU backend that does not implement it: the full system test's WITHGPU stage stopped with "Error registering memory for GPU". Metal memory is shared with the host, and GPUMemCpy copies from memory outside the Metal buffers on the host, so there is nothing to pin: accept the registration as the CPU backend does.
1 parent 2ecb908 commit f4847b7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎GPU/GPUTracking/Base/metal/GPUReconstructionMetal.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class GPUReconstructionMetal : public GPUReconstructionProcessing::KernelInterfa
4646
size_t GPUMemCpy(void* dst, const void* src, size_t size, int32_t stream, int32_t toGPU, deviceEvent* ev = nullptr, deviceEvent* evList = nullptr, int32_t nEvents = 1) override;
4747
void ReleaseEvent(deviceEvent ev) override;
4848
void RecordMarker(deviceEvent* ev, int32_t stream) override;
49+
// The memory is shared with the host, and GPUMemCpy copies from memory outside the Metal buffers on the
50+
// host, so there is nothing to pin.
51+
int32_t registerMemoryForGPU_internal(const void* ptr, size_t size) override { return 0; }
52+
int32_t unregisterMemoryForGPU_internal(const void* ptr) override { return 0; }
4953

5054
template <class T, int32_t I = 0>
5155
int32_t AddKernel();

0 commit comments

Comments
 (0)