Skip to content

Chained scan unit test - #287

Open
keptsecret wants to merge 9 commits into
masterfrom
device_chained_scan
Open

Chained scan unit test#287
keptsecret wants to merge 9 commits into
masterfrom
device_chained_scan

Conversation

@keptsecret

Copy link
Copy Markdown
Contributor

No description provided.


struct device_capabilities
{
#ifdef TEST_NATIVE

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nitpicking: If you do { "TEST_NATIVE", "1" } to enable this, it should be #if not #ifdef

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeeed

// Normally we'd beautifully JSON serialize the thing, allow multiple devices & drivers + metadata
auto bin = cpu->getEntries().begin()->second.bin;
IFile::success_t success;
m_spirv_isa_cache_output->write(success, bin->data(), 0ull, bin->size());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't seem to get the purpose or benefit of the pipeline cache in this example it looks completely unnecessary.
It gets constantly overwritten
and you could actually create a single pipeline per workgroup conf at runtime and not any sort of pipeline cache.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slightly faster startup if shader did not change

@Erfan-Ahmadi Erfan-Ahmadi Aug 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I did not know how pipeline caches work. I though they are overwritten when passed to each create pipeline.
anyways, feels like 95% of the time required for shaders remains to be shader preprocessing and hlsl->spirv compilation with different defines each run of the test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can cache that too

Comment on lines +23 to +28
value = scratch[ix];
}
template<typename AccessType, typename IndexType>
void set(const uint32_t ix, const AccessType value)
{
scratch[ix] = value;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw if you want these to be visible to other invocations under Vulkan memory model, you might want to use SPIR-V OpLoad MakeVisible and OpStore MakeAvailable with NonPrivatePointer semantics I think

Comment on lines +108 to +115
bda::__ptr<T> target = ptr + index;
value = target.template deref().load();
}
template<typename AccessType, typename IndexType>
void set(const IndexType index, const AccessType value)
{
bda::__ptr<T> target = ptr + index;
return target.template deref().store(value);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think our bda::__ptr needs a load/store method with make available and visible (+ non private)

Its only atomics where avail and vis + non-privateness is implied

//passed = validateResults<Arithmetic, arithmetic::multiplies<uint32_t>>(itemsPerWG, workgroupCount, subgroupSize, itemsPerInvoc) && passed;
//passed = validateResults<Arithmetic, arithmetic::minimum<uint32_t>>(itemsPerWG, workgroupCount, subgroupSize, itemsPerInvoc) && passed;
//passed = validateResults<Arithmetic, arithmetic::maximum<uint32_t>>(itemsPerWG, workgroupCount, subgroupSize, itemsPerInvoc) && passed;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not check all ops ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants