We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From @fwyzard in https://github.com/cms-patatrack/cmssw/pull/301/files#r279369606
The pattern seems to be:
Payload *cablingMapHost = nullptr; // pointer to struct in CPU
struct PayloadWrapper { ~PayloadWrapper(); Payload *payload = nullptr; // pointer to struct in GPU };
CUDAESProduct<PayloadWrapper> payload_;
Payload const* getGPUProductAsync(cuda::stream_t<>& cudaStream) const { const auto& data = payload_.dataForCurrentDeviceAsync(cudaStream, [this](PayloadWrapper& data, cuda::stream_t<>& stream) { // allocate cudaCheck(cudaMalloc(&data.payload, sizeof(Payload))); // transfer cudaCheck(cudaMemcpyAsync(data.payload, this->cablingMapHost, sizeof(Payload), cudaMemcpyDefault, stream.id())); }); return data.payload; }
Would it make sense to encapsulate more of the common part into CUDAESProduct ?
CUDAESProduct
And/or to drop the PayloadWrapper in favour of a unique_ptr, possibly with a custom destructor ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
From @fwyzard in https://github.com/cms-patatrack/cmssw/pull/301/files#r279369606
The pattern seems to be:
Would it make sense to encapsulate more of the common part into
CUDAESProduct
?And/or to drop the PayloadWrapper in favour of a unique_ptr, possibly with a custom destructor ?
The text was updated successfully, but these errors were encountered: