| Line |
Branch |
Exec |
Source |
| 1 |
|
|
// SPDX-License-Identifier: BSD-3-Clause |
| 2 |
|
|
#pragma once |
| 3 |
|
|
|
| 4 |
|
|
#include <algorithm> |
| 5 |
|
|
#include <array> |
| 6 |
|
|
#include <concepts> |
| 7 |
|
|
#include <cstdint> |
| 8 |
|
|
#include <deque> |
| 9 |
|
|
#include <memory> |
| 10 |
|
|
#include <mutex> |
| 11 |
|
|
#include <optional> |
| 12 |
|
|
#include <span> |
| 13 |
|
|
#include <string> |
| 14 |
|
|
#include <string_view> |
| 15 |
|
|
#include <utility> |
| 16 |
|
|
#include <variant> |
| 17 |
|
|
#include <vector> |
| 18 |
|
|
|
| 19 |
|
|
#include <fmt/format.h> |
| 20 |
|
|
|
| 21 |
|
|
#include "chrono_batch_render/device/buffer.h" |
| 22 |
|
|
#include "chrono_batch_render/device/commands.h" |
| 23 |
|
|
#include "chrono_batch_render/device/compute/runtime_compiler.h" |
| 24 |
|
|
#include "chrono_batch_render/device/device.h" |
| 25 |
|
|
#include "chrono_batch_render/device/queue.h" |
| 26 |
|
|
#include "chrono_batch_render/device/slang/compiler.h" |
| 27 |
|
|
#include "chrono_batch_render/device/texture.h" |
| 28 |
|
|
#include "chrono_batch_render/util/disk_cache.h" |
| 29 |
|
|
#include "chrono_batch_render/util/error.h" |
| 30 |
|
|
#include "chrono_batch_render/util/profiler.h" |
| 31 |
|
|
|
| 32 |
|
|
namespace chrono::batch_render::device::compute { |
| 33 |
|
|
|
| 34 |
|
|
constexpr uint32_t kMaxParamBytes = 4096; |
| 35 |
|
|
constexpr unsigned kMaxAnisotropy = 16; |
| 36 |
|
|
|
| 37 |
|
✗ |
struct ComputeDevice { |
| 38 |
|
|
Backend backend; |
| 39 |
|
|
uint32_t ordinal; |
| 40 |
|
|
std::string name; |
| 41 |
|
|
std::array<uint8_t, 16> uuid; |
| 42 |
|
|
uint64_t memory; |
| 43 |
|
|
bool integrated; |
| 44 |
|
|
uint32_t warpSize; |
| 45 |
|
|
uint32_t maxThreads; |
| 46 |
|
|
bool textures; |
| 47 |
|
|
}; |
| 48 |
|
|
|
| 49 |
|
✗ |
inline AdapterInfo DescribeCompute(const ComputeDevice& device) { |
| 50 |
|
✗ |
AdapterInfo adapter; |
| 51 |
|
✗ |
adapter.backend = device.backend; |
| 52 |
|
✗ |
adapter.ordinal = device.ordinal; |
| 53 |
0/1
✗ Branch 1 not taken.
|
✗ |
adapter.name = device.name; |
| 54 |
|
✗ |
adapter.uuid = device.uuid; |
| 55 |
|
✗ |
adapter.memoryBytes = device.memory; |
| 56 |
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
adapter.type = device.integrated ? AdapterType::Integrated : AdapterType::Discrete; |
| 57 |
|
|
|
| 58 |
|
✗ |
Features& features = adapter.features; |
| 59 |
|
✗ |
features.unifiedMemory = device.integrated; |
| 60 |
|
✗ |
features.hostMappedMemory = device.integrated; |
| 61 |
|
✗ |
features.externalMemory = true; |
| 62 |
|
✗ |
features.kernelStatistics = true; |
| 63 |
|
✗ |
features.hardwareTextures = device.textures; |
| 64 |
|
✗ |
features.anisotropicFiltering = device.textures; |
| 65 |
|
✗ |
features.float64 = true; |
| 66 |
|
✗ |
features.atomicFloat32Add = true; |
| 67 |
|
✗ |
features.atomicInt64 = true; |
| 68 |
|
✗ |
features.shaderClock = true; |
| 69 |
|
✗ |
features.waveSizeMin = features.waveSizeMax = device.warpSize; |
| 70 |
|
|
|
| 71 |
|
✗ |
adapter.limits.maxBufferBytes = device.memory; |
| 72 |
|
✗ |
adapter.limits.maxGroupSize = device.maxThreads; |
| 73 |
|
✗ |
adapter.limits.maxParamBytes = kMaxParamBytes; |
| 74 |
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
adapter.limits.maxAnisotropy = device.textures ? float(kMaxAnisotropy) : 1.0f; |
| 75 |
|
✗ |
adapter.limits.maxReservedBytes = adapter.limits.maxBufferBytes; |
| 76 |
|
✗ |
return adapter; |
| 77 |
|
✗ |
} |
| 78 |
|
|
|
| 79 |
|
|
constexpr uint64_t kPoolKeptBytes = 256ull * 1024 * 1024; |
| 80 |
|
|
|
| 81 |
|
|
template <class T> |
| 82 |
|
|
concept ComputeTraits = |
| 83 |
|
|
requires(const T::Device& device, const T::Api& api, T::Stream stream, T::Event event, |
| 84 |
|
|
T::Graph graph, T::Pool pool, uint64_t address, void* host, const void* source, |
| 85 |
|
|
uint64_t bytes, uint32_t value, bool flag, T::Module module, T::Function function, |
| 86 |
|
|
const std::string& binary, Size3 groups, const T::ArrayDesc& array, |
| 87 |
|
|
const T::ResourceDesc& resource, const T::SamplerDesc& sampler) { |
| 88 |
|
|
{ device.Functions() } -> std::same_as<const typename T::Api&>; |
| 89 |
|
|
T::Enter(device); |
| 90 |
|
|
|
| 91 |
|
|
{ T::Allocate(api, bytes) } -> std::same_as<uint64_t>; |
| 92 |
|
|
{ T::Free(api, address) } -> std::same_as<void>; |
| 93 |
|
|
{ T::CreatePool(device, bytes) } -> std::same_as<typename T::Pool>; |
| 94 |
|
|
{ T::DestroyPool(api, pool) } -> std::same_as<void>; |
| 95 |
|
|
{ T::AllocateFrom(api, pool, bytes, stream) } -> std::same_as<uint64_t>; |
| 96 |
|
|
{ T::FreeTo(api, address, stream) } -> std::same_as<void>; |
| 97 |
|
|
{ T::SynchronizeStream(api, stream) } -> std::same_as<void>; |
| 98 |
|
|
{ T::AllocateHost(api, bytes, flag) } -> std::same_as<void*>; |
| 99 |
|
|
{ T::DeviceAddress(api, host) } -> std::same_as<uint64_t>; |
| 100 |
|
|
{ T::FreeHost(api, host) } -> std::same_as<void>; |
| 101 |
|
|
|
| 102 |
|
|
{ T::CreateStream(api) } -> std::same_as<typename T::Stream>; |
| 103 |
|
|
{ T::DestroyStream(api, stream) } -> std::same_as<void>; |
| 104 |
|
|
{ T::CreateEvent(api, flag) } -> std::same_as<typename T::Event>; |
| 105 |
|
|
{ T::DestroyEvent(api, event) } -> std::same_as<void>; |
| 106 |
|
|
{ T::Record(api, event, stream, flag) } -> std::same_as<void>; |
| 107 |
|
|
{ T::WaitEvent(api, stream, event) } -> std::same_as<void>; |
| 108 |
|
|
{ T::ApplicationStream(host) } -> std::same_as<typename T::Stream>; |
| 109 |
|
|
{ T::ElapsedNs(api, event, event) } -> std::same_as<uint64_t>; |
| 110 |
|
|
{ T::Query(api, event) } -> std::same_as<bool>; |
| 111 |
|
|
{ T::Synchronize(api, event) } -> std::same_as<void>; |
| 112 |
|
|
{ T::Copy(api, address, address, bytes, stream) } -> std::same_as<void>; |
| 113 |
|
|
{ T::Fill(api, address, value, bytes, stream) } -> std::same_as<void>; |
| 114 |
|
|
{ T::Upload(api, address, source, bytes, stream) } -> std::same_as<void>; |
| 115 |
|
|
{ T::CreateTextureArray(api, array, value) } -> std::same_as<void*>; |
| 116 |
|
|
{ T::DestroyTextureArray(api, host) } -> std::same_as<void>; |
| 117 |
|
|
{ T::TextureLevel(api, host, value) } -> std::same_as<void*>; |
| 118 |
|
|
{ T::CreateTextureObject(api, resource, sampler) } -> std::same_as<uint64_t>; |
| 119 |
|
|
{ T::DestroyTextureObject(api, address) } -> std::same_as<void>; |
| 120 |
|
|
{ T::CopyToArray(api, host, address, bytes, value, stream) } -> std::same_as<void>; |
| 121 |
|
|
T::BeginCapture(api, stream); |
| 122 |
|
|
{ T::EndCapture(api, stream) } -> std::same_as<typename T::Graph>; |
| 123 |
|
|
{ T::LaunchGraph(api, graph, stream) } -> std::same_as<void>; |
| 124 |
|
|
{ T::DestroyGraph(api, graph) } -> std::same_as<void>; |
| 125 |
|
|
|
| 126 |
|
|
{ T::RuntimeCompiler() } -> std::same_as<const RuntimeCompiler&>; |
| 127 |
|
|
{ T::Prelude() } -> std::same_as<std::string_view>; |
| 128 |
|
|
{ |
| 129 |
|
|
T::CompileOptions(binary, groups, value, flag) |
| 130 |
|
|
} -> std::same_as<std::vector<std::string>>; |
| 131 |
|
|
{ T::LoadModule(api, binary) } -> std::same_as<typename T::Module>; |
| 132 |
|
|
{ T::UnloadModule(api, module) } -> std::same_as<void>; |
| 133 |
|
|
{ T::Symbol(api, module, binary.c_str()) } -> std::same_as<std::pair<uint64_t, size_t>>; |
| 134 |
|
|
{ T::CopyToDevice(api, address, source, bytes) } -> std::same_as<void>; |
| 135 |
|
|
{ T::GetFunction(api, module, binary.c_str()) } -> std::same_as<typename T::Function>; |
| 136 |
|
|
{ T::Stats(api, function) } -> std::same_as<KernelStats>; |
| 137 |
|
|
{ T::Launch(api, function, groups, groups, &host, stream) } -> std::same_as<void>; |
| 138 |
|
|
{ T::kParamBuffer } -> std::convertible_to<uintptr_t>; |
| 139 |
|
|
{ T::kParamBufferSize } -> std::convertible_to<uintptr_t>; |
| 140 |
|
|
{ T::kParamEnd } -> std::convertible_to<uintptr_t>; |
| 141 |
|
|
}; |
| 142 |
|
|
|
| 143 |
|
|
template <ComputeTraits Traits> |
| 144 |
|
✗ |
void ExternalCopy(const typename Traits::Device& device, BufferRange dst, uint64_t source, |
| 145 |
|
|
Stream producer) { |
| 146 |
|
✗ |
const auto scope = Traits::Enter(device); |
| 147 |
0/4
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::cuda::Traits>(chrono::batch_render::device::cuda::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::hip::Traits>(chrono::batch_render::device::hip::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
const typename Traits::Api& api = device.Functions(); |
| 148 |
0/4
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::cuda::Traits>(chrono::batch_render::device::cuda::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::hip::Traits>(chrono::batch_render::device::hip::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (producer.IsCompute()) { |
| 149 |
0/2
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::cuda::Traits>(chrono::batch_render::device::cuda::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::hip::Traits>(chrono::batch_render::device::hip::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
|
✗ |
Traits::Copy(api, dst.Address(), source, dst.Bytes(), |
| 150 |
|
|
Traits::ApplicationStream(producer.Handle())); |
| 151 |
|
|
return; |
| 152 |
|
|
} |
| 153 |
0/4
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::cuda::Traits>(chrono::batch_render::device::cuda::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::hip::Traits>(chrono::batch_render::device::hip::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
|
✗ |
const typename Traits::Stream stream = Traits::CreateStream(api); |
| 154 |
0/2
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::cuda::Traits>(chrono::batch_render::device::cuda::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::hip::Traits>(chrono::batch_render::device::hip::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
|
✗ |
Traits::Copy(api, dst.Address(), source, dst.Bytes(), stream); |
| 155 |
0/2
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::cuda::Traits>(chrono::batch_render::device::cuda::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::hip::Traits>(chrono::batch_render::device::hip::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
|
✗ |
Traits::SynchronizeStream(api, stream); |
| 156 |
0/2
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::cuda::Traits>(chrono::batch_render::device::cuda::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
void chrono::batch_render::device::compute::ExternalCopy<chrono::batch_render::device::hip::Traits>(chrono::batch_render::device::hip::Traits::Device const&, chrono::batch_render::device::BufferRange, unsigned long, chrono::batch_render::Stream):
✗ Branch 1 not taken.
|
✗ |
Traits::DestroyStream(api, stream); |
| 157 |
|
✗ |
} |
| 158 |
|
|
|
| 159 |
|
|
template <ComputeTraits Traits> class ComputeQueue; |
| 160 |
|
|
|
| 161 |
|
|
template <ComputeTraits Traits> class ComputeBuffer : public Buffer { |
| 162 |
|
|
public: |
| 163 |
|
|
using Device = Traits::Device; |
| 164 |
|
|
|
| 165 |
|
✗ |
static Ref<Buffer> Create(Device& device, const BufferDesc& desc) { |
| 166 |
|
✗ |
const auto scope = Traits::Enter(device); |
| 167 |
0/6
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
|
✗ |
Ref<ComputeBuffer> buffer(new ComputeBuffer(device, desc)); |
| 168 |
|
✗ |
const auto& api = buffer->Functions(); |
| 169 |
0/4
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
switch (desc.memory) { |
| 170 |
|
✗ |
case Memory::Device: |
| 171 |
0/2
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
|
✗ |
buffer->m_queue = &static_cast<ComputeQueue<Traits>&>(device.GetQueue()); |
| 172 |
0/2
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
|
✗ |
buffer->m_address = buffer->m_queue->Allocate(desc.bytes); |
| 173 |
|
✗ |
break; |
| 174 |
|
✗ |
default: |
| 175 |
0/4
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
|
✗ |
buffer->m_mapped = Traits::AllocateHost(api, desc.bytes, desc.memory == Memory::Upload); |
| 176 |
0/2
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
|
✗ |
buffer->m_address = Traits::DeviceAddress(api, buffer->m_mapped); |
| 177 |
|
✗ |
break; |
| 178 |
|
|
} |
| 179 |
0/4
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
return buffer; |
| 180 |
|
✗ |
} |
| 181 |
|
|
|
| 182 |
|
✗ |
~ComputeBuffer() override { |
| 183 |
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 184 |
0/4
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::~ComputeBuffer():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::~ComputeBuffer():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_mapped != nullptr) { |
| 185 |
|
✗ |
Traits::FreeHost(Functions(), m_mapped); |
| 186 |
0/4
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::~ComputeBuffer():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::~ComputeBuffer():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
} else if (m_address != 0) { |
| 187 |
|
✗ |
m_queue->Free(m_address); |
| 188 |
|
|
} |
| 189 |
|
✗ |
} |
| 190 |
|
|
|
| 191 |
|
|
private: |
| 192 |
0/2
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
|
✗ |
ComputeBuffer(Device& device, const BufferDesc& desc) : Buffer(device, desc) {} |
| 193 |
|
|
|
| 194 |
|
|
const ComputeQueue<Traits>* m_queue = nullptr; |
| 195 |
|
|
|
| 196 |
|
✗ |
const Device& Owner() const { |
| 197 |
|
✗ |
return static_cast<const Device&>(GetDevice()); |
| 198 |
|
|
} |
| 199 |
|
|
|
| 200 |
0/4
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
✗ |
const Traits::Api& Functions() const { |
| 201 |
0/4
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::cuda::Traits>::Create(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
chrono::batch_render::device::compute::ComputeBuffer<chrono::batch_render::device::hip::Traits>::Create(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::BufferDesc const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
✗ |
return Owner().Functions(); |
| 202 |
|
|
} |
| 203 |
|
|
}; |
| 204 |
|
|
|
| 205 |
|
|
struct ArrayFormat { |
| 206 |
|
|
int format; |
| 207 |
|
|
unsigned channels; |
| 208 |
|
|
}; |
| 209 |
|
|
|
| 210 |
|
✗ |
inline ArrayFormat TextureArrayFormat(const TextureDesc& desc) { |
| 211 |
|
✗ |
constexpr int kUnsigned8 = 0x01; |
| 212 |
|
✗ |
constexpr int kUnsigned16 = 0x02; |
| 213 |
|
✗ |
constexpr int kHalf = 0x10; |
| 214 |
|
✗ |
constexpr int kFloat = 0x20; |
| 215 |
|
✗ |
constexpr ArrayFormat kFormats[] = {{kUnsigned8, 1}, {kUnsigned8, 2}, {kUnsigned8, 4}, |
| 216 |
|
|
{kUnsigned16, 1}, {kUnsigned16, 2}, {kUnsigned16, 4}, |
| 217 |
|
|
{kHalf, 1}, {kHalf, 2}, {kHalf, 4}, |
| 218 |
|
|
{kFloat, 1}, {kFloat, 2}, {kFloat, 4}}; |
| 219 |
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (TexelBlockSide(desc.format) != 1) { |
| 220 |
|
✗ |
throw UnsupportedError( |
| 221 |
0/1
✗ Branch 2 not taken.
|
✗ |
"texture \"{}\" is block compressed, which texture objects can't hold", desc.label); |
| 222 |
|
|
} |
| 223 |
|
✗ |
return kFormats[uint32_t(desc.format)]; |
| 224 |
|
|
} |
| 225 |
|
|
|
| 226 |
|
|
template <ComputeTraits Traits> class ComputeTexture : public Texture { |
| 227 |
|
|
public: |
| 228 |
|
|
using Device = Traits::Device; |
| 229 |
|
|
|
| 230 |
|
✗ |
ComputeTexture(Device& device, const TextureDesc& desc) |
| 231 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::ComputeTexture(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::TextureDesc const&):
✗ Branch 2 not taken.
✗ Branch 5 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::ComputeTexture(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::TextureDesc const&):
✗ Branch 2 not taken.
✗ Branch 5 not taken.
|
✗ |
: Texture(device, desc), m_format(TextureArrayFormat(desc)) { |
| 232 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::ComputeTexture(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::TextureDesc const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::ComputeTexture(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::TextureDesc const&):
✗ Branch 1 not taken.
|
✗ |
const auto scope = Traits::Enter(device); |
| 233 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::ComputeTexture(chrono::batch_render::device::cuda::CudaDevice&, chrono::batch_render::device::TextureDesc const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::ComputeTexture(chrono::batch_render::device::hip::HipDevice&, chrono::batch_render::device::TextureDesc const&):
✗ Branch 1 not taken.
|
✗ |
m_records = Traits::Allocate(Functions(), sizeof(m_objects)); |
| 234 |
|
|
try { |
| 235 |
|
✗ |
m_array = Traits::CreateTextureArray(Functions(), |
| 236 |
|
✗ |
{.Width = desc.width, |
| 237 |
|
✗ |
.Height = desc.height, |
| 238 |
|
✗ |
.Format = m_format.format, |
| 239 |
|
✗ |
.NumChannels = m_format.channels}, |
| 240 |
|
✗ |
desc.levels); |
| 241 |
|
✗ |
} catch (...) { |
| 242 |
|
✗ |
Traits::Free(Functions(), m_records); |
| 243 |
|
✗ |
throw; |
| 244 |
|
|
} |
| 245 |
|
✗ |
} |
| 246 |
|
|
|
| 247 |
|
✗ |
~ComputeTexture() override { |
| 248 |
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 249 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::~ComputeTexture():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::~ComputeTexture():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
for (const TextureObjects& objects : m_objects) { |
| 250 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::~ComputeTexture():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::~ComputeTexture():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (objects.filtered != 0) { |
| 251 |
|
✗ |
Traits::DestroyTextureObject(Functions(), objects.filtered); |
| 252 |
|
✗ |
Traits::DestroyTextureObject(Functions(), objects.texels); |
| 253 |
|
|
} |
| 254 |
|
|
} |
| 255 |
|
✗ |
Traits::Free(Functions(), m_records); |
| 256 |
|
✗ |
Traits::DestroyTextureArray(Functions(), m_array); |
| 257 |
|
✗ |
} |
| 258 |
|
|
|
| 259 |
|
✗ |
uint64_t KernelHandle(TextureWrap wrapS, TextureWrap wrapT) override { |
| 260 |
|
✗ |
const uint32_t index = TextureHandle(0, wrapS, wrapT); |
| 261 |
|
✗ |
const uint64_t address = m_records + uint64_t(index) * sizeof(TextureObjects); |
| 262 |
|
✗ |
const std::lock_guard lock(m_mutex); |
| 263 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
TextureObjects& objects = m_objects[index]; |
| 264 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (objects.filtered == 0) { |
| 265 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 266 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
|
✗ |
const TextureDesc& desc = Desc(); |
| 267 |
|
✗ |
constexpr int kMipmappedArray = 1; |
| 268 |
|
✗ |
typename Traits::ResourceDesc resource{.resType = kMipmappedArray}; |
| 269 |
|
✗ |
resource.res.mipmap.hMipmappedArray = m_array; |
| 270 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
|
✗ |
objects = {.filtered = Traits::CreateTextureObject(Functions(), resource, |
| 271 |
|
✗ |
Sampler(wrapS, wrapT, true)), |
| 272 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
|
✗ |
.texels = Traits::CreateTextureObject(Functions(), resource, |
| 273 |
|
✗ |
Sampler(wrapS, wrapT, false)), |
| 274 |
|
✗ |
.width = desc.width, |
| 275 |
|
✗ |
.height = desc.height, |
| 276 |
|
✗ |
.numLevels = desc.levels, |
| 277 |
|
✗ |
.channels = m_format.channels}; |
| 278 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::KernelHandle(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap):
✗ Branch 1 not taken.
|
✗ |
Traits::CopyToDevice(Functions(), address, &objects, sizeof(objects)); |
| 279 |
|
✗ |
} |
| 280 |
|
✗ |
return address; |
| 281 |
|
✗ |
} |
| 282 |
|
|
|
| 283 |
|
✗ |
void Copy(uint32_t level, uint64_t source, Traits::Stream stream) const { |
| 284 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
const TextureDesc& desc = Desc(); |
| 285 |
|
✗ |
Traits::CopyToArray(Functions(), Traits::TextureLevel(Functions(), m_array, level), source, |
| 286 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
uint64_t(TextureLevelSide(desc.width, level)) * |
| 287 |
|
✗ |
TexelBlockBytes(desc.format), |
| 288 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
TextureLevelSide(desc.height, level), stream); |
| 289 |
|
✗ |
} |
| 290 |
|
|
|
| 291 |
|
|
private: |
| 292 |
|
|
ArrayFormat m_format; |
| 293 |
|
|
void* m_array = nullptr; |
| 294 |
|
|
uint64_t m_records = 0; |
| 295 |
|
|
std::array<TextureObjects, kTextureSamplers> m_objects{}; |
| 296 |
|
|
std::mutex m_mutex; |
| 297 |
|
|
|
| 298 |
|
✗ |
const Device& Owner() const { |
| 299 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 1 not taken.
|
✗ |
return static_cast<const Device&>(GetDevice()); |
| 300 |
|
|
} |
| 301 |
|
|
|
| 302 |
0/12
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
|
✗ |
const Traits::Api& Functions() const { |
| 303 |
0/12
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Copy(unsigned int, unsigned long, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
|
✗ |
return Owner().Functions(); |
| 304 |
|
|
} |
| 305 |
|
|
|
| 306 |
|
✗ |
Traits::SamplerDesc Sampler(TextureWrap wrapS, TextureWrap wrapT, bool filtered) const { |
| 307 |
|
✗ |
constexpr int kPoint = 0; |
| 308 |
|
✗ |
constexpr int kLinear = 1; |
| 309 |
|
✗ |
constexpr unsigned kNormalizedCoordinates = 0x02; |
| 310 |
|
✗ |
constexpr unsigned kSrgb = 0x10; |
| 311 |
|
✗ |
const auto address = [](TextureWrap wrap) { |
| 312 |
|
✗ |
constexpr int kModes[] = {0, 2, 1, 3}; |
| 313 |
|
✗ |
return kModes[uint32_t(wrap)]; |
| 314 |
|
|
}; |
| 315 |
0/4
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Sampler(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap, bool) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Sampler(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap, bool) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
const TextureDesc& desc = Desc(); |
| 316 |
|
✗ |
return {.addressMode = {address(wrapS), address(wrapT), address(wrapT)}, |
| 317 |
|
✗ |
.filterMode = filtered ? kLinear : kPoint, |
| 318 |
|
✗ |
.flags = kNormalizedCoordinates | |
| 319 |
|
✗ |
(desc.colorSpace == TexelColorSpace::Srgb ? kSrgb : 0u), |
| 320 |
|
✗ |
.maxAnisotropy = filtered ? kMaxAnisotropy : 1, |
| 321 |
|
|
.mipmapFilterMode = filtered ? kLinear : kPoint, |
| 322 |
0/12
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Sampler(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap, bool) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Sampler(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap, bool) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
✗ |
.maxMipmapLevelClamp = float(desc.levels - 1)}; |
| 323 |
|
|
} |
| 324 |
|
|
}; |
| 325 |
|
|
|
| 326 |
|
✗ |
template <ComputeTraits Traits> struct LoadedModule { |
| 327 |
|
|
Traits::Module module{}; |
| 328 |
|
|
uint64_t dispatchArgs = 0; |
| 329 |
|
|
uint64_t counts = 0; |
| 330 |
|
|
}; |
| 331 |
|
|
|
| 332 |
|
|
template <ComputeTraits Traits> class ComputeKernel : public Kernel { |
| 333 |
|
|
public: |
| 334 |
|
|
using Device = Traits::Device; |
| 335 |
|
|
|
| 336 |
0/2
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::cuda::Traits>::Sampler(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap, bool) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeTexture<chrono::batch_render::device::hip::Traits>::Sampler(chrono::batch_render::TextureWrap, chrono::batch_render::TextureWrap, bool) const:
✗ Branch 1 not taken.
|
✗ |
explicit ComputeKernel(Device& owner) : m_owner(owner) {} |
| 337 |
|
|
|
| 338 |
|
✗ |
void Launch(const Traits::Api& api, Size3 groups, uint64_t counts, const void* params, |
| 339 |
|
|
uint32_t bytes, Traits::Stream stream) const { |
| 340 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Launch(chrono::batch_render::device::cuda::Api const&, chrono::batch_render::device::Size3, unsigned long, void const*, unsigned int, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Launch(chrono::batch_render::device::hip::Api const&, chrono::batch_render::device::Size3, unsigned long, void const*, unsigned int, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
uint64_t& written = m_module->counts; |
| 341 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Launch(chrono::batch_render::device::cuda::Api const&, chrono::batch_render::device::Size3, unsigned long, void const*, unsigned int, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Launch(chrono::batch_render::device::hip::Api const&, chrono::batch_render::device::Size3, unsigned long, void const*, unsigned int, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (counts != written) { |
| 342 |
|
✗ |
Traits::Fill(api, m_module->dispatchArgs, uint32_t(counts), 4, stream); |
| 343 |
|
✗ |
Traits::Fill(api, m_module->dispatchArgs + 4, uint32_t(counts >> 32), 4, stream); |
| 344 |
|
✗ |
written = counts; |
| 345 |
|
|
} |
| 346 |
|
✗ |
size_t size = bytes; |
| 347 |
|
✗ |
void* extra[] = {reinterpret_cast<void*>(Traits::kParamBuffer), const_cast<void*>(params), |
| 348 |
|
|
reinterpret_cast<void*>(Traits::kParamBufferSize), &size, |
| 349 |
|
|
reinterpret_cast<void*>(Traits::kParamEnd)}; |
| 350 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Launch(chrono::batch_render::device::cuda::Api const&, chrono::batch_render::device::Size3, unsigned long, void const*, unsigned int, chrono::batch_render::device::cuda::CUstream_st*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Launch(chrono::batch_render::device::hip::Api const&, chrono::batch_render::device::Size3, unsigned long, void const*, unsigned int, chrono::batch_render::device::hip::ihipStream_t*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
Traits::Launch(api, m_function, groups, GroupSize(), bytes > 0 ? extra : nullptr, stream); |
| 351 |
|
✗ |
} |
| 352 |
|
|
|
| 353 |
|
✗ |
uint64_t& Counts() const { |
| 354 |
|
✗ |
return m_module->counts; |
| 355 |
|
|
} |
| 356 |
|
|
|
| 357 |
|
|
static constexpr uint64_t kUnknownCounts = ~uint64_t(0); |
| 358 |
|
|
|
| 359 |
|
|
protected: |
| 360 |
|
✗ |
KernelStats Load(const KernelCode& code, const DiskCache& cache, |
| 361 |
|
|
const DeviceGlobals& globals) override { |
| 362 |
|
✗ |
const RuntimeCompiler& compiler = Traits::RuntimeCompiler(); |
| 363 |
|
✗ |
const std::string& architecture = m_owner.Adapter().architecture; |
| 364 |
|
✗ |
const std::vector<std::string> options = Traits::CompileOptions( |
| 365 |
|
✗ |
architecture, code.shape.groupSize, code.shape.maxRegisters, code.debugInfo); |
| 366 |
|
✗ |
const SourceHeader prelude{kPreludeHeader, Traits::Prelude()}; |
| 367 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
|
✗ |
const RuntimeCompiler::Compiled binary = |
| 368 |
|
|
compiler.CompileCached(code.code, {&prelude, 1}, options, |
| 369 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
|
✗ |
fmt::format("kernel {} of program \"{}\" for {}", Name(), |
| 370 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
|
✗ |
GetProgram().Label(), architecture), |
| 371 |
|
|
cache); |
| 372 |
|
|
|
| 373 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
|
✗ |
const auto scope = Traits::Enter(m_owner); |
| 374 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
|
✗ |
const auto& api = m_owner.Functions(); |
| 375 |
0/10
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
|
✗ |
m_module = |
| 376 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const:
✗ Branch 1 not taken.
|
✗ |
std::static_pointer_cast<LoadedModule<Traits>>(m_owner.Modules().Find(binary.code, [&] { |
| 377 |
|
✗ |
Device& owner = m_owner; |
| 378 |
|
✗ |
const std::shared_ptr<LoadedModule<Traits>> loaded( |
| 379 |
|
✗ |
new LoadedModule<Traits>{}, [&owner](LoadedModule<Traits>* unloading) { |
| 380 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (unloading->module != Module{}) { |
| 381 |
|
✗ |
const auto unloadScope = Traits::Enter(owner); |
| 382 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 1 not taken.
|
✗ |
Traits::UnloadModule(owner.Functions(), unloading->module); |
| 383 |
|
✗ |
} |
| 384 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
delete unloading; |
| 385 |
|
|
}); |
| 386 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 1 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 1 not taken.
✗ Branch 4 not taken.
|
✗ |
loaded->module = Traits::LoadModule(api, binary.code); |
| 387 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
const auto [globalsAddress, globalsBytes] = |
| 388 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 1 not taken.
|
✗ |
Traits::Symbol(api, loaded->module, "SLANG_globalParams"); |
| 389 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (globalsAddress != 0) { |
| 390 |
|
✗ |
Traits::CopyToDevice(api, globalsAddress, &globals, |
| 391 |
0/10
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
✗ |
std::min<uint64_t>(globalsBytes, sizeof(globals))); |
| 392 |
|
|
} |
| 393 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
loaded->dispatchArgs = |
| 394 |
0/6
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
|
✗ |
Traits::Symbol(api, loaded->module, "chrono_batch_render_dispatch_args").first; |
| 395 |
0/4
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
return std::shared_ptr<void>(loaded); |
| 396 |
|
✗ |
})); |
| 397 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 1 not taken.
|
✗ |
m_function = Traits::GetFunction(api, m_module->module, Name().c_str()); |
| 398 |
|
|
|
| 399 |
0/2
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::cuda::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::cuda::Traits>*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeKernel<chrono::batch_render::device::hip::Traits>::Load(chrono::batch_render::device::KernelCode const&, chrono::batch_render::DiskCache const&, chrono::batch_render::DeviceGlobals const&)::{lambda()#1}::operator()() const::{lambda(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*)#1}::operator()(chrono::batch_render::device::compute::LoadedModule<chrono::batch_render::device::hip::Traits>*) const:
✗ Branch 1 not taken.
|
✗ |
KernelStats stats = Traits::Stats(api, m_function); |
| 400 |
|
✗ |
stats.cached = binary.cached; |
| 401 |
|
✗ |
return stats; |
| 402 |
|
✗ |
} |
| 403 |
|
|
|
| 404 |
|
|
private: |
| 405 |
|
|
using Module = Traits::Module; |
| 406 |
|
|
|
| 407 |
|
|
Device& m_owner; |
| 408 |
|
|
std::shared_ptr<LoadedModule<Traits>> m_module; |
| 409 |
|
|
Traits::Function m_function{}; |
| 410 |
|
|
}; |
| 411 |
|
|
|
| 412 |
|
|
template <ComputeTraits Traits> class ComputeQueue : public Queue { |
| 413 |
|
|
public: |
| 414 |
|
|
using Device = Traits::Device; |
| 415 |
|
|
|
| 416 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::ComputeQueue(chrono::batch_render::device::cuda::CudaDevice&):
✗ Branch 2 not taken.
✗ Branch 5 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::ComputeQueue(chrono::batch_render::device::hip::HipDevice&):
✗ Branch 2 not taken.
✗ Branch 5 not taken.
|
✗ |
explicit ComputeQueue(Device& device) : Queue(device) { |
| 417 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::ComputeQueue(chrono::batch_render::device::cuda::CudaDevice&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::ComputeQueue(chrono::batch_render::device::hip::HipDevice&):
✗ Branch 1 not taken.
|
✗ |
const auto scope = Traits::Enter(device); |
| 418 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::ComputeQueue(chrono::batch_render::device::cuda::CudaDevice&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::ComputeQueue(chrono::batch_render::device::hip::HipDevice&):
✗ Branch 1 not taken.
|
✗ |
m_stream = Traits::CreateStream(Functions()); |
| 419 |
|
|
try { |
| 420 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::ComputeQueue(chrono::batch_render::device::cuda::CudaDevice&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::ComputeQueue(chrono::batch_render::device::hip::HipDevice&):
✗ Branch 1 not taken.
|
✗ |
m_pool = Traits::CreatePool(device, kPoolKeptBytes); |
| 421 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::ComputeQueue(chrono::batch_render::device::cuda::CudaDevice&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::ComputeQueue(chrono::batch_render::device::hip::HipDevice&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_pool != Pool{}) { |
| 422 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::ComputeQueue(chrono::batch_render::device::cuda::CudaDevice&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::ComputeQueue(chrono::batch_render::device::hip::HipDevice&):
✗ Branch 1 not taken.
|
✗ |
m_allocationStream = Traits::CreateStream(Functions()); |
| 423 |
|
|
} |
| 424 |
|
✗ |
} catch (...) { |
| 425 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::ComputeQueue(chrono::batch_render::device::cuda::CudaDevice&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::ComputeQueue(chrono::batch_render::device::hip::HipDevice&):
✗ Branch 1 not taken.
|
✗ |
DestroyStreams(); |
| 426 |
|
✗ |
throw; |
| 427 |
|
|
} |
| 428 |
|
✗ |
} |
| 429 |
|
|
|
| 430 |
|
✗ |
~ComputeQueue() override { |
| 431 |
|
|
try { |
| 432 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::~ComputeQueue():
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::~ComputeQueue():
✗ Branch 1 not taken.
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 433 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::~ComputeQueue():
✗ Branch 1 not taken.
✗ Branch 2 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::~ComputeQueue():
✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
✗ |
for (const Pending& pending : m_pending) { |
| 434 |
|
✗ |
Traits::DestroyEvent(Functions(), pending.event); |
| 435 |
|
|
} |
| 436 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::~ComputeQueue():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::~ComputeQueue():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
for (const Event event : m_free) { |
| 437 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::~ComputeQueue():
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::~ComputeQueue():
✗ Branch 1 not taken.
|
✗ |
Traits::DestroyEvent(Functions(), event); |
| 438 |
|
|
} |
| 439 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::~ComputeQueue():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::~ComputeQueue():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_anchorStream != Stream{}) { |
| 440 |
|
✗ |
Traits::DestroyEvent(Functions(), m_anchor); |
| 441 |
|
✗ |
Traits::DestroyStream(Functions(), m_anchorStream); |
| 442 |
|
|
} |
| 443 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::~ComputeQueue():
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::~ComputeQueue():
✗ Branch 1 not taken.
|
✗ |
DestroyStreams(); |
| 444 |
|
✗ |
} catch (...) { // NOLINT(bugprone-empty-catch) |
| 445 |
|
|
} |
| 446 |
|
✗ |
} |
| 447 |
|
|
|
| 448 |
|
✗ |
uint64_t Allocate(uint64_t bytes) const { |
| 449 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Allocate(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Allocate(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_pool == Pool{}) { |
| 450 |
|
✗ |
return Traits::Allocate(Functions(), bytes); |
| 451 |
|
|
} |
| 452 |
|
|
const uint64_t address = |
| 453 |
|
✗ |
Traits::AllocateFrom(Functions(), m_pool, bytes, m_allocationStream); |
| 454 |
|
✗ |
Traits::SynchronizeStream(Functions(), m_allocationStream); |
| 455 |
|
✗ |
return address; |
| 456 |
|
|
} |
| 457 |
|
|
|
| 458 |
|
✗ |
void Free(uint64_t address) const { |
| 459 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Free(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Free(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_pool == Pool{}) { |
| 460 |
|
✗ |
Traits::Free(Functions(), address); |
| 461 |
|
|
} else { |
| 462 |
|
✗ |
Traits::FreeTo(Functions(), address, m_allocationStream); |
| 463 |
|
✗ |
Traits::SynchronizeStream(Functions(), m_allocationStream); |
| 464 |
|
|
} |
| 465 |
|
✗ |
} |
| 466 |
|
|
|
| 467 |
|
|
protected: |
| 468 |
|
✗ |
void Execute(const CommandBuffer& queued, const CommandBuffer& commands, |
| 469 |
|
|
const Timestamps* timestamps, uint64_t value) override { |
| 470 |
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 471 |
|
✗ |
const auto* events = static_cast<const EventTimestamps*>(timestamps); |
| 472 |
0/6
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
|
✗ |
Run(queued, {}); |
| 473 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (!commands.Reusable()) { |
| 474 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
Run(commands, {.timestamps = events}); |
| 475 |
|
|
} else { |
| 476 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
Replay(commands, events); |
| 477 |
|
|
} |
| 478 |
|
|
|
| 479 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
const Event event = TakeEvent(); |
| 480 |
|
✗ |
Traits::Record(Functions(), event, m_stream, false); |
| 481 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
const std::lock_guard lock(m_mutex); |
| 482 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Execute(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::Queue::Timestamps const*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
m_pending.push_back({value, event}); |
| 483 |
|
✗ |
} |
| 484 |
|
|
|
| 485 |
|
✗ |
std::shared_ptr<Timestamps> CreateTimestamps(uint32_t count) override { |
| 486 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::CreateTimestamps(unsigned int):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::CreateTimestamps(unsigned int):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
return std::make_shared<EventTimestamps>(*this, count); |
| 487 |
|
|
} |
| 488 |
|
|
|
| 489 |
|
✗ |
bool SharesStreams() override { |
| 490 |
|
✗ |
return true; |
| 491 |
|
|
} |
| 492 |
|
|
|
| 493 |
|
✗ |
void* NativeStream() override { |
| 494 |
|
✗ |
return m_stream; |
| 495 |
|
|
} |
| 496 |
|
|
|
| 497 |
|
✗ |
void FollowStream(void* stream) override { |
| 498 |
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 499 |
|
✗ |
const auto& api = Functions(); |
| 500 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::FollowStream(void*):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::FollowStream(void*):
✗ Branch 1 not taken.
|
✗ |
const Event event = Traits::CreateEvent(api, false); |
| 501 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::FollowStream(void*):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::FollowStream(void*):
✗ Branch 1 not taken.
|
✗ |
Traits::Record(api, event, Traits::ApplicationStream(stream), false); |
| 502 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::FollowStream(void*):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::FollowStream(void*):
✗ Branch 1 not taken.
|
✗ |
Traits::WaitEvent(api, m_stream, event); |
| 503 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::FollowStream(void*):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::FollowStream(void*):
✗ Branch 1 not taken.
|
✗ |
Traits::DestroyEvent(api, event); |
| 504 |
|
✗ |
} |
| 505 |
|
|
|
| 506 |
|
✗ |
void StreamWait(void* stream, uint64_t) override { |
| 507 |
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 508 |
|
✗ |
const auto& api = Functions(); |
| 509 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::StreamWait(void*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::StreamWait(void*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
const Event event = Traits::CreateEvent(api, false); |
| 510 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::StreamWait(void*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::StreamWait(void*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
Traits::Record(api, event, m_stream, false); |
| 511 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::StreamWait(void*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::StreamWait(void*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
Traits::WaitEvent(api, Traits::ApplicationStream(stream), event); |
| 512 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::StreamWait(void*, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::StreamWait(void*, unsigned long):
✗ Branch 1 not taken.
|
✗ |
Traits::DestroyEvent(api, event); |
| 513 |
|
✗ |
} |
| 514 |
|
|
|
| 515 |
|
✗ |
uint64_t Finished() const override { |
| 516 |
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 517 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Finished() const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Finished() const:
✗ Branch 1 not taken.
|
✗ |
const std::lock_guard lock(m_mutex); |
| 518 |
0/10
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Finished() const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Finished() const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
✗ |
while (!m_pending.empty() && Traits::Query(Functions(), m_pending.front().event)) { |
| 519 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Finished() const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Finished() const:
✗ Branch 1 not taken.
|
✗ |
m_finished = m_pending.front().value; |
| 520 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Finished() const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Finished() const:
✗ Branch 1 not taken.
|
✗ |
m_free.push_back(m_pending.front().event); |
| 521 |
|
✗ |
m_pending.pop_front(); |
| 522 |
|
|
} |
| 523 |
|
✗ |
return m_finished; |
| 524 |
|
✗ |
} |
| 525 |
|
|
|
| 526 |
|
✗ |
void WaitFor(uint64_t value) const override { |
| 527 |
|
✗ |
Event event{}; |
| 528 |
|
|
{ |
| 529 |
|
✗ |
const std::lock_guard lock(m_mutex); |
| 530 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::WaitFor(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::WaitFor(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_finished >= value) { |
| 531 |
|
✗ |
return; |
| 532 |
|
|
} |
| 533 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::WaitFor(unsigned long) const:
✗ Branch 1 not taken.
✗ Branch 2 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::WaitFor(unsigned long) const:
✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
✗ |
for (const Pending& pending : m_pending) { |
| 534 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::WaitFor(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::WaitFor(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (pending.value >= value) { |
| 535 |
|
✗ |
event = pending.event; |
| 536 |
|
✗ |
break; |
| 537 |
|
|
} |
| 538 |
|
|
} |
| 539 |
|
✗ |
} |
| 540 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::WaitFor(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::WaitFor(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (event != Event{}) { |
| 541 |
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 542 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::WaitFor(unsigned long) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::WaitFor(unsigned long) const:
✗ Branch 1 not taken.
|
✗ |
Traits::Synchronize(Functions(), event); |
| 543 |
|
✗ |
} |
| 544 |
|
✗ |
Finished(); |
| 545 |
|
|
} |
| 546 |
|
|
|
| 547 |
|
|
private: |
| 548 |
|
|
using Stream = Traits::Stream; |
| 549 |
|
|
using Event = Traits::Event; |
| 550 |
|
|
using Pool = Traits::Pool; |
| 551 |
|
|
|
| 552 |
|
|
struct Pending { |
| 553 |
|
|
uint64_t value; |
| 554 |
|
|
Event event; |
| 555 |
|
|
}; |
| 556 |
|
|
|
| 557 |
|
✗ |
const Device& Owner() const { |
| 558 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::WaitFor(unsigned long) const:
✗ Branch 1 not taken.
✗ Branch 9 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::WaitFor(unsigned long) const:
✗ Branch 1 not taken.
✗ Branch 9 not taken.
|
✗ |
return static_cast<const Device&>(GetDevice()); |
| 559 |
|
|
} |
| 560 |
|
|
|
| 561 |
0/24
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::WaitFor(unsigned long) const:
✗ Branch 1 not taken.
✗ Branch 7 not taken.
✗ Branch 10 not taken.
✗ Branch 13 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✗ Branch 25 not taken.
✗ Branch 28 not taken.
✗ Branch 31 not taken.
✗ Branch 37 not taken.
✗ Branch 40 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::WaitFor(unsigned long) const:
✗ Branch 1 not taken.
✗ Branch 7 not taken.
✗ Branch 10 not taken.
✗ Branch 13 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✗ Branch 25 not taken.
✗ Branch 28 not taken.
✗ Branch 31 not taken.
✗ Branch 37 not taken.
✗ Branch 40 not taken.
|
✗ |
const Traits::Api& Functions() const { |
| 562 |
0/34
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::WaitFor(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✗ Branch 22 not taken.
✗ Branch 25 not taken.
✗ Branch 28 not taken.
✗ Branch 31 not taken.
✗ Branch 34 not taken.
✗ Branch 37 not taken.
✗ Branch 40 not taken.
✗ Branch 43 not taken.
✗ Branch 46 not taken.
✗ Branch 56 not taken.
✗ Branch 59 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::WaitFor(unsigned long) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✗ Branch 22 not taken.
✗ Branch 25 not taken.
✗ Branch 28 not taken.
✗ Branch 31 not taken.
✗ Branch 34 not taken.
✗ Branch 37 not taken.
✗ Branch 40 not taken.
✗ Branch 43 not taken.
✗ Branch 46 not taken.
✗ Branch 56 not taken.
✗ Branch 59 not taken.
|
✗ |
return Owner().Functions(); |
| 563 |
|
|
} |
| 564 |
|
|
|
| 565 |
|
|
struct EventTimestamps : Timestamps { |
| 566 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits> const&, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits> const&, unsigned long):
✗ Branch 1 not taken.
|
✗ |
EventTimestamps(const ComputeQueue& owner, size_t count) : queue(owner) { |
| 567 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits> const&, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits> const&, unsigned long):
✗ Branch 1 not taken.
|
✗ |
const auto scope = Traits::Enter(owner.Owner()); |
| 568 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits> const&, unsigned long):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits> const&, unsigned long):
✗ Branch 1 not taken.
|
✗ |
events.reserve(count); |
| 569 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits> const&, unsigned long):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits> const&, unsigned long):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
for (size_t i = 0; i < count; ++i) { |
| 570 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits> const&, unsigned long):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::EventTimestamps(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits> const&, unsigned long):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
|
✗ |
events.push_back(Traits::CreateEvent(owner.Functions(), true)); |
| 571 |
|
|
} |
| 572 |
|
✗ |
} |
| 573 |
|
|
|
| 574 |
|
✗ |
~EventTimestamps() override { |
| 575 |
|
|
try { |
| 576 |
|
✗ |
const auto scope = Traits::Enter(queue.Owner()); |
| 577 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::~EventTimestamps():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::~EventTimestamps():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
for (const Event event : events) { |
| 578 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::~EventTimestamps():
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::~EventTimestamps():
✗ Branch 1 not taken.
|
✗ |
Traits::DestroyEvent(queue.Functions(), event); |
| 579 |
|
|
} |
| 580 |
|
✗ |
} catch (...) { // NOLINT(bugprone-empty-catch) |
| 581 |
|
|
} |
| 582 |
|
✗ |
} |
| 583 |
|
|
|
| 584 |
|
|
EventTimestamps(const EventTimestamps&) = delete; |
| 585 |
|
|
EventTimestamps& operator=(const EventTimestamps&) = delete; |
| 586 |
|
|
|
| 587 |
|
✗ |
bool Read(std::span<uint64_t> ns) const override { |
| 588 |
|
✗ |
const auto scope = Traits::Enter(queue.Owner()); |
| 589 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::Read(std::span<unsigned long, 18446744073709551615ul>) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::Read(std::span<unsigned long, 18446744073709551615ul>) const:
✗ Branch 1 not taken.
|
✗ |
const auto [anchor, anchorNs] = queue.Anchor(); |
| 590 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::Read(std::span<unsigned long, 18446744073709551615ul>) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::Read(std::span<unsigned long, 18446744073709551615ul>) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
for (size_t i = 0; i < ns.size(); ++i) { |
| 591 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps::Read(std::span<unsigned long, 18446744073709551615ul>) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps::Read(std::span<unsigned long, 18446744073709551615ul>) const:
✗ Branch 1 not taken.
|
✗ |
ns[i] = anchorNs - Traits::ElapsedNs(queue.Functions(), events[i], anchor); |
| 592 |
|
|
} |
| 593 |
|
✗ |
return true; |
| 594 |
|
✗ |
} |
| 595 |
|
|
|
| 596 |
|
|
const ComputeQueue& queue; |
| 597 |
|
|
std::vector<Event> events; |
| 598 |
|
|
}; |
| 599 |
|
|
|
| 600 |
|
✗ |
struct Graph { |
| 601 |
|
|
Traits::Graph graph{}; |
| 602 |
|
|
uint64_t data = 0; |
| 603 |
|
|
std::vector<std::pair<const ComputeKernel<Traits>*, uint64_t>> counts; |
| 604 |
|
|
}; |
| 605 |
|
|
|
| 606 |
|
|
struct RunDesc { |
| 607 |
|
|
uint64_t data = 0; |
| 608 |
|
|
const EventTimestamps* timestamps = nullptr; |
| 609 |
|
|
bool capturing = false; |
| 610 |
|
|
}; |
| 611 |
|
|
|
| 612 |
|
✗ |
void Run(const CommandBuffer& list, const RunDesc& desc) const { |
| 613 |
|
✗ |
const auto& api = Functions(); |
| 614 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::RunDesc const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::RunDesc const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
for (const Command& command : list.Commands()) { |
| 615 |
|
✗ |
std::visit( |
| 616 |
|
|
Overloaded{ |
| 617 |
|
✗ |
[&](const CopyCommand& c) { |
| 618 |
|
✗ |
Traits::Copy(api, c.dst->Address() + c.dstOffset, |
| 619 |
|
✗ |
c.src->Address() + c.srcOffset, c.bytes, m_stream); |
| 620 |
|
|
}, |
| 621 |
|
✗ |
[&](const FillCommand& c) { |
| 622 |
|
✗ |
Traits::Fill(api, c.dst->Address() + c.offset, c.value, c.bytes, m_stream); |
| 623 |
|
|
}, |
| 624 |
|
✗ |
[&](const UpdateCommand& c) { |
| 625 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::RunDesc const&) const::{lambda(chrono::batch_render::device::UpdateCommand const&)#1}::operator()(chrono::batch_render::device::UpdateCommand const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::RunDesc const&) const::{lambda(chrono::batch_render::device::UpdateCommand const&)#1}::operator()(chrono::batch_render::device::UpdateCommand const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (desc.data != 0) { |
| 626 |
|
✗ |
Traits::Copy(api, c.dst->Address() + c.offset, desc.data + c.data, |
| 627 |
|
✗ |
c.bytes, m_stream); |
| 628 |
|
|
} else { |
| 629 |
|
✗ |
Traits::Upload(api, c.dst->Address() + c.offset, list.Data(c), c.bytes, |
| 630 |
|
✗ |
m_stream); |
| 631 |
|
|
} |
| 632 |
|
|
}, |
| 633 |
|
|
[&](const BarrierCommand&) {}, |
| 634 |
|
✗ |
[&](const ZoneCommand& c) { |
| 635 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::RunDesc const&) const::{lambda(chrono::batch_render::device::ZoneCommand const&)#1}::operator()(chrono::batch_render::device::ZoneCommand const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::RunDesc const&) const::{lambda(chrono::batch_render::device::ZoneCommand const&)#1}::operator()(chrono::batch_render::device::ZoneCommand const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (desc.timestamps != nullptr) { |
| 636 |
|
✗ |
Traits::Record(api, |
| 637 |
|
✗ |
desc.timestamps->events[2 * c.index + (c.begin ? 0 : 1)], |
| 638 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::RunDesc const&) const::{lambda(chrono::batch_render::device::ZoneCommand const&)#1}::operator()(chrono::batch_render::device::ZoneCommand const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::RunDesc const&) const::{lambda(chrono::batch_render::device::ZoneCommand const&)#1}::operator()(chrono::batch_render::device::ZoneCommand const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
m_stream, desc.capturing); |
| 639 |
|
|
} |
| 640 |
|
|
}, |
| 641 |
|
|
[&](const BuildAccelCommand&) {}, |
| 642 |
|
✗ |
[&](const TextureCopyCommand& c) { |
| 643 |
|
✗ |
static_cast<const ComputeTexture<Traits>&>(*c.dst).Copy( |
| 644 |
|
✗ |
c.level, c.src->Address() + c.srcOffset, m_stream); |
| 645 |
|
|
}, |
| 646 |
|
✗ |
[&](const DispatchCommand& c) { |
| 647 |
|
✗ |
const uint64_t counts = |
| 648 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::RunDesc const&) const::{lambda(chrono::batch_render::device::DispatchCommand const&)#1}::operator()(chrono::batch_render::device::DispatchCommand const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Run(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::RunDesc const&) const::{lambda(chrono::batch_render::device::DispatchCommand const&)#1}::operator()(chrono::batch_render::device::DispatchCommand const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
c.counts != nullptr ? c.counts->Address() + c.countsOffset : 0; |
| 649 |
|
✗ |
Kernel(c).Launch(api, c.groups, counts, list.Data(c), c.paramBytes, |
| 650 |
|
✗ |
m_stream); |
| 651 |
|
|
}, |
| 652 |
|
|
}, |
| 653 |
|
|
command); |
| 654 |
|
|
} |
| 655 |
|
✗ |
} |
| 656 |
|
|
|
| 657 |
|
✗ |
static const ComputeKernel<Traits>& Kernel(const DispatchCommand& dispatch) { |
| 658 |
|
✗ |
return static_cast<const ComputeKernel<Traits>&>(*dispatch.kernel); |
| 659 |
|
|
} |
| 660 |
|
|
|
| 661 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Replay(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Replay(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
void Replay(const CommandBuffer& commands, const EventTimestamps* timestamps) const { |
| 662 |
|
✗ |
std::shared_ptr<void>& recording = Recording(commands); |
| 663 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Replay(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Replay(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (!recording) { |
| 664 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Replay(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const:
✗ Branch 1 not taken.
✗ Branch 2 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Replay(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const:
✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
✗ |
recording = Capture(commands, timestamps); |
| 665 |
|
|
} |
| 666 |
|
✗ |
const Graph& graph = *static_cast<const Graph*>(recording.get()); |
| 667 |
|
✗ |
Traits::LaunchGraph(Functions(), graph.graph, m_stream); |
| 668 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Replay(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Replay(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
for (const auto& [kernel, counts] : graph.counts) { |
| 669 |
|
✗ |
kernel->Counts() = counts; |
| 670 |
|
|
} |
| 671 |
|
✗ |
} |
| 672 |
|
|
|
| 673 |
|
✗ |
Event TakeEvent() { |
| 674 |
|
|
{ |
| 675 |
|
✗ |
const std::lock_guard lock(m_mutex); |
| 676 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::TakeEvent():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::TakeEvent():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (!m_free.empty()) { |
| 677 |
|
✗ |
const Event event = m_free.back(); |
| 678 |
|
✗ |
m_free.pop_back(); |
| 679 |
|
✗ |
return event; |
| 680 |
|
|
} |
| 681 |
|
✗ |
} |
| 682 |
|
✗ |
return Traits::CreateEvent(Functions(), false); |
| 683 |
|
|
} |
| 684 |
|
|
|
| 685 |
|
✗ |
std::shared_ptr<Graph> Capture(const CommandBuffer& commands, |
| 686 |
|
|
const EventTimestamps* timestamps) const { |
| 687 |
|
✗ |
const auto& api = Functions(); |
| 688 |
|
✗ |
std::shared_ptr<Graph> graph(new Graph, [this](Graph* freed) { |
| 689 |
|
|
try { |
| 690 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 1 not taken.
|
✗ |
const auto scope = Traits::Enter(Owner()); |
| 691 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (freed->graph != typename Traits::Graph{}) { |
| 692 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 1 not taken.
|
✗ |
Traits::DestroyGraph(Functions(), freed->graph); |
| 693 |
|
|
} |
| 694 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (freed->data != 0) { |
| 695 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 1 not taken.
|
✗ |
Free(freed->data); |
| 696 |
|
|
} |
| 697 |
|
✗ |
} catch (...) { // NOLINT(bugprone-empty-catch) |
| 698 |
|
|
} |
| 699 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
delete freed; |
| 700 |
|
|
}); |
| 701 |
|
|
|
| 702 |
|
✗ |
const std::span<const std::byte> data = commands.Data(); |
| 703 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
const bool updates = std::ranges::any_of(commands.Commands(), [](const Command& command) { |
| 704 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
return std::holds_alternative<UpdateCommand>(command); |
| 705 |
|
|
}); |
| 706 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (updates) { |
| 707 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 1 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 1 not taken.
✗ Branch 4 not taken.
|
✗ |
graph->data = Allocate(data.size()); |
| 708 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 1 not taken.
|
✗ |
Traits::CopyToDevice(api, graph->data, data.data(), data.size()); |
| 709 |
|
|
} |
| 710 |
|
|
|
| 711 |
0/8
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
✗ |
for (const Command& command : commands.Commands()) { |
| 712 |
|
✗ |
if (const auto* dispatch = std::get_if<DispatchCommand>(&command)) { |
| 713 |
|
✗ |
Kernel(*dispatch).Counts() = ComputeKernel<Traits>::kUnknownCounts; |
| 714 |
|
|
} |
| 715 |
|
|
} |
| 716 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 1 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 1 not taken.
✗ Branch 4 not taken.
|
✗ |
graph->graph = RecordGraph(commands, graph->data, timestamps); |
| 717 |
0/6
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Graph*) const:
✗ Branch 1 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Capture(chrono::batch_render::device::CommandBuffer const&, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const::{lambda(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*)#1}::operator()(chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Graph*) const:
✗ Branch 1 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
✗ |
graph->counts = KernelCounts(commands); |
| 718 |
|
✗ |
return graph; |
| 719 |
|
✗ |
} |
| 720 |
|
|
|
| 721 |
|
✗ |
Traits::Graph RecordGraph(const CommandBuffer& commands, uint64_t data, |
| 722 |
|
|
const EventTimestamps* timestamps) const { |
| 723 |
|
✗ |
const auto& api = Functions(); |
| 724 |
|
✗ |
Traits::BeginCapture(api, m_stream); |
| 725 |
|
|
try { |
| 726 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::RecordGraph(chrono::batch_render::device::CommandBuffer const&, unsigned long, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const:
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::RecordGraph(chrono::batch_render::device::CommandBuffer const&, unsigned long, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const:
✗ Branch 1 not taken.
|
✗ |
Run(commands, {.data = data, .timestamps = timestamps, .capturing = true}); |
| 727 |
|
✗ |
} catch (...) { |
| 728 |
|
|
try { |
| 729 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::RecordGraph(chrono::batch_render::device::CommandBuffer const&, unsigned long, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const:
✗ Branch 1 not taken.
✗ Branch 4 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::RecordGraph(chrono::batch_render::device::CommandBuffer const&, unsigned long, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const:
✗ Branch 1 not taken.
✗ Branch 4 not taken.
|
✗ |
Traits::DestroyGraph(api, Traits::EndCapture(api, m_stream)); |
| 730 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::RecordGraph(chrono::batch_render::device::CommandBuffer const&, unsigned long, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::EventTimestamps const*) const:
✗ Branch 2 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::RecordGraph(chrono::batch_render::device::CommandBuffer const&, unsigned long, chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::EventTimestamps const*) const:
✗ Branch 2 not taken.
|
✗ |
} catch (...) { // NOLINT(bugprone-empty-catch) |
| 731 |
|
|
} |
| 732 |
|
✗ |
throw; |
| 733 |
|
|
} |
| 734 |
|
✗ |
return Traits::EndCapture(api, m_stream); |
| 735 |
|
|
} |
| 736 |
|
|
|
| 737 |
|
|
static std::vector<std::pair<const ComputeKernel<Traits>*, uint64_t>> |
| 738 |
|
✗ |
KernelCounts(const CommandBuffer& commands) { |
| 739 |
|
✗ |
std::vector<std::pair<const ComputeKernel<Traits>*, uint64_t>> counts; |
| 740 |
0/8
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::KernelCounts(chrono::batch_render::device::CommandBuffer const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::KernelCounts(chrono::batch_render::device::CommandBuffer const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
✗ |
for (const Command& command : commands.Commands()) { |
| 741 |
|
✗ |
if (const auto* dispatch = std::get_if<DispatchCommand>(&command)) { |
| 742 |
|
✗ |
const ComputeKernel<Traits>* kernel = &Kernel(*dispatch); |
| 743 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::KernelCounts(chrono::batch_render::device::CommandBuffer const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::KernelCounts(chrono::batch_render::device::CommandBuffer const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
✗ |
if (std::ranges::none_of(counts, |
| 744 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::KernelCounts(chrono::batch_render::device::CommandBuffer const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::KernelCounts(chrono::batch_render::device::CommandBuffer const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
[&](const auto& held) { return held.first == kernel; })) { |
| 745 |
0/2
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::KernelCounts(chrono::batch_render::device::CommandBuffer const&):
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::KernelCounts(chrono::batch_render::device::CommandBuffer const&):
✗ Branch 1 not taken.
|
✗ |
counts.emplace_back(kernel, kernel->Counts()); |
| 746 |
|
|
} |
| 747 |
|
|
} |
| 748 |
|
|
} |
| 749 |
|
✗ |
return counts; |
| 750 |
|
✗ |
} |
| 751 |
|
|
|
| 752 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Anchor() const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Anchor() const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
std::pair<Event, uint64_t> Anchor() const { |
| 753 |
|
✗ |
const auto& api = Functions(); |
| 754 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::Anchor() const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::Anchor() const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_anchorStream == Stream{}) { |
| 755 |
|
✗ |
m_anchorStream = Traits::CreateStream(api); |
| 756 |
|
✗ |
m_anchor = Traits::CreateEvent(api, true); |
| 757 |
|
|
} |
| 758 |
|
✗ |
const uint64_t before = profiler::Now(); |
| 759 |
|
✗ |
Traits::Record(api, m_anchor, m_anchorStream, false); |
| 760 |
|
✗ |
Traits::Synchronize(api, m_anchor); |
| 761 |
|
✗ |
const uint64_t after = profiler::Now(); |
| 762 |
|
✗ |
return {m_anchor, before + (after - before) / 2}; |
| 763 |
|
|
} |
| 764 |
|
|
|
| 765 |
|
✗ |
void DestroyStreams() { |
| 766 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::DestroyStreams():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::DestroyStreams():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_allocationStream != Stream{}) { |
| 767 |
|
✗ |
Traits::SynchronizeStream(Functions(), m_allocationStream); |
| 768 |
|
✗ |
Traits::DestroyStream(Functions(), m_allocationStream); |
| 769 |
|
|
} |
| 770 |
0/4
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::cuda::Traits>::DestroyStreams():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
chrono::batch_render::device::compute::ComputeQueue<chrono::batch_render::device::hip::Traits>::DestroyStreams():
✗ Branch 0 not taken.
✗ Branch 1 not taken.
|
✗ |
if (m_pool != Pool{}) { |
| 771 |
|
✗ |
Traits::DestroyPool(Functions(), m_pool); |
| 772 |
|
|
} |
| 773 |
|
✗ |
Traits::DestroyStream(Functions(), m_stream); |
| 774 |
|
✗ |
} |
| 775 |
|
|
|
| 776 |
|
|
Stream m_stream{}; |
| 777 |
|
|
Pool m_pool{}; |
| 778 |
|
|
Stream m_allocationStream{}; |
| 779 |
|
|
mutable Stream m_anchorStream{}; |
| 780 |
|
|
mutable Event m_anchor{}; |
| 781 |
|
|
mutable std::mutex m_mutex; |
| 782 |
|
|
mutable std::deque<Pending> m_pending; |
| 783 |
|
|
mutable std::vector<Event> m_free; |
| 784 |
|
|
mutable uint64_t m_finished = 0; |
| 785 |
|
|
}; |
| 786 |
|
|
|
| 787 |
|
|
} |
| 788 |
|
|
|