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

adds SPIR-V tests for scalar printf operands #2211

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bashbaug
Copy link
Contributor

@bashbaug bashbaug commented Jan 7, 2025

Adds targeted SPIR-V tests for printf with scalar operands. See:

The fp32 test is likely to be the most interesting, especially on devices that support fp64, because printf with scalar fp32 operands is not generated by default in this case with Clang and the SPIR-V LLVM Translator.

// TODO: Unify with test_printf.
struct StreamGrabber
{
StreamGrabber(): tempFileName(get_temp_filename()) {}
Copy link
Member

Choose a reason for hiding this comment

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

This leaks: get_temp_filename() returns a char * that needs to be free()d, but here after initialization that pointer is lost so the memory itself never gets freed.

const char* spirvFileName,
const char* kernelName,
const char* expectedResults, T value)
{
Copy link
Member

Choose a reason for hiding this comment

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

The new tests currently fail on our implementation because the output isn't captured (the OpenCL spec leaves the "output stream" implementation defined). The printf suite already has some extra handling to set up a call-back if the cl_arm_printf extension is supported (see #434); any chance you could add such handling to this test?

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.

2 participants