diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-16 12:52:07 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-16 12:52:07 +0100 |
| commit | 83322562ce0c33a8026611471dc7b1b3241bce64 (patch) | |
| tree | c7702f33b02e7eb639eb26c8708030e46e4e52fe /src/gpu/sequence_v2.cc | |
| parent | f03f3428991499e0701cce5eacc2bb943fde9d8e (diff) | |
refactor: invert FATAL_CHECK logic to standard assertion style
- Inverted FATAL_CHECK macro to crash if condition is FALSE (standard assertion)
- Updated all call sites in audio, GPU, and CNN subsystems
- Updated documentation and examples
- Recorded completion in doc/COMPLETED.md
Diffstat (limited to 'src/gpu/sequence_v2.cc')
| -rw-r--r-- | src/gpu/sequence_v2.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/sequence_v2.cc b/src/gpu/sequence_v2.cc index 9e30db0..7c44085 100644 --- a/src/gpu/sequence_v2.cc +++ b/src/gpu/sequence_v2.cc @@ -38,7 +38,7 @@ NodeRegistry::~NodeRegistry() { void NodeRegistry::declare_node(const std::string& name, NodeType type, int width, int height) { - FATAL_CHECK(nodes_.find(name) != nodes_.end(), + FATAL_CHECK(nodes_.find(name) == nodes_.end(), "Node already declared: %s\n", name.c_str()); if (width <= 0) @@ -57,9 +57,9 @@ void NodeRegistry::declare_node(const std::string& name, NodeType type, void NodeRegistry::declare_aliased_node(const std::string& name, const std::string& alias_of) { - FATAL_CHECK(nodes_.find(alias_of) == nodes_.end(), + FATAL_CHECK(nodes_.find(alias_of) != nodes_.end(), "Alias target does not exist: %s\n", alias_of.c_str()); - FATAL_CHECK(aliases_.find(name) != aliases_.end(), "Alias already exists: %s\n", + FATAL_CHECK(aliases_.find(name) == aliases_.end(), "Alias already exists: %s\n", name.c_str()); aliases_[name] = alias_of; @@ -73,7 +73,7 @@ WGPUTextureView NodeRegistry::get_view(const std::string& name) { } auto it = nodes_.find(name); - FATAL_CHECK(it == nodes_.end(), "Node not found: %s\n", name.c_str()); + FATAL_CHECK(it != nodes_.end(), "Node not found: %s\n", name.c_str()); return it->second.view; } @@ -161,7 +161,7 @@ void NodeRegistry::create_texture(Node& node) { desc.sampleCount = 1; node.texture = wgpuDeviceCreateTexture(device_, &desc); - FATAL_CHECK(node.texture == nullptr, "Failed to create texture\n"); + FATAL_CHECK(node.texture != nullptr, "Failed to create texture\n"); WGPUTextureViewDescriptor view_desc = {}; view_desc.format = format; @@ -175,7 +175,7 @@ void NodeRegistry::create_texture(Node& node) { : WGPUTextureAspect_All; node.view = wgpuTextureCreateView(node.texture, &view_desc); - FATAL_CHECK(node.view == nullptr, "Failed to create texture view\n"); + FATAL_CHECK(node.view != nullptr, "Failed to create texture view\n"); } // SequenceV2 implementation |
