Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metal Task Shader payload #4238

Merged
merged 16 commits into from
Jun 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tests/metal/simple-task.slang
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
//TEST:SIMPLE(filecheck=CHECK): -target metal
//TEST:SIMPLE(filecheck=CHECK-ASM): -target metallib
//TEST:REFLECTION(filecheck=REFLECT):-target metal -entry main_kernel -stage task
// TEST:SIMPLE(filecheck=CHECK): -target metal
Copy link
Collaborator

Choose a reason for hiding this comment

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

There shouldn't be a space between // and TEST, otherwise the test won't get picked up by our test driver.

// TEST:SIMPLE(filecheck=CHECK-ASM): -target metallib
// TEST:REFLECTION(filecheck=REFLECT):-target metal -entry main_kernel -stage task

// CHECK: 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't quite understand these results. Can we put something more meaningful here, such as:

// CHECK: _slang_mgp.set_threadgroups_per_grid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added some checks that should work, however I can't get the tests to run on my macbook, the runner keeps ignoring them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Our test runner just try to run the metal command directly, so it needs to be made available from PATH. We should probably enhance the logic in locateMetalCompiler in slang-metal-compiler.cpp so that it can discover metal sdk on macos.

// CHECK-NEXT: 1
// CHECK-NEXT: 8
// CHECK-NEXT: 27

// TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer

Expand Down