From 0e57e5544d6e3530ea7ae69d5bd988f41bf29f66 Mon Sep 17 00:00:00 2001 From: Pranav Sivaraman <14294205+pranav-sivaraman@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:07:42 -0800 Subject: [PATCH] feat(sycl): use hostToDevice/deviceToHost timers --- src/sycl/fasten.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sycl/fasten.hpp b/src/sycl/fasten.hpp index 74850f0..e709214 100644 --- a/src/sycl/fasten.hpp +++ b/src/sycl/fasten.hpp @@ -198,9 +198,9 @@ template class IMPL_CLS final : public Bude { auto device = devices[deviceIdx]; Sample sample(PPWI, wgsize, p.nposes()); - - auto contextStart = now(); sycl::queue queue(device); + + auto hostToDeviceStart = now(); sycl::buffer proteins(p.protein.data(), p.protein.size()); sycl::buffer ligands(p.ligand.data(), p.ligand.size()); sycl::buffer forcefields(p.forcefield.data(), p.forcefield.size()); @@ -212,8 +212,8 @@ template class IMPL_CLS final : public Bude { sycl::buffer transforms_5(p.poses[5].data(), p.poses[5].size()); sycl::buffer energies(sample.energies.size()); queue.wait_and_throw(); - auto contextEnd = now(); - sample.contextTime = {contextStart, contextEnd}; + auto hostToDeviceEnd = now(); + sample.hostToDevice = {hostToDeviceStart, hostToDeviceEnd}; for (size_t i = 0; i < p.iterations + p.warmupIterations; ++i) { auto kernelStart = now(); @@ -229,9 +229,12 @@ template class IMPL_CLS final : public Bude { sample.kernelTimes.emplace_back(kernelStart, kernelEnd); } + auto deviceToHostStart = now(); queue.submit([&](sycl::handler &h) { h.copy(energies.get_access(h), sample.energies.data()); }); queue.wait_and_throw(); + auto deviceToHostEnd = now(); + sample.deviceToHost = {deviceToHostStart, deviceToHostEnd}; return sample; }; -}; \ No newline at end of file +};