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

[CUDA] printfs results in ptxas error: Call has wrong number of parameters #1154

Closed
fwyzard opened this issue Feb 20, 2020 · 7 comments · Fixed by #4293
Closed

[CUDA] printfs results in ptxas error: Call has wrong number of parameters #1154

fwyzard opened this issue Feb 20, 2020 · 7 comments · Fixed by #4293
Assignees
Labels
bug Something isn't working cuda CUDA back-end libclc libclc project related issues

Comments

@fwyzard
Copy link
Contributor

fwyzard commented Feb 20, 2020

Testing the latest iteration of #1091 (as of 44af06f2eb0) on top of the HEAD of the sycl branch (as of 7743e86) with a SYCLE kernel that calls printf, the compilation for the CUDA backend fails with

ptxas /tmp/fwyzard/main_oneapi-2cd1b3.s, line 516; error   : Call has wrong number of parameters
ptxas /tmp/fwyzard/main_oneapi-2cd1b3.s, line 721; error   : Call has wrong number of parameters
ptxas /tmp/fwyzard/main_oneapi-2cd1b3.s, line 890; error   : Call has wrong number of parameters
ptxas /tmp/fwyzard/main_oneapi-2cd1b3.s, line 1543; error   : Call has wrong number of parameters
ptxas /tmp/fwyzard/main_oneapi-2cd1b3.s, line 1643; error   : Call has wrong number of parameters
ptxas fatal   : Ptx assembly aborted due to errors
clang-11: error: ptxas command failed with exit code 255 (use -v to see invocation)

All errors point to similar PTX code:

        call.uni (retval0),
        _Z18__spirv_ocl_printfPU3AS4Kcz,
        (
        param0,
        param1
        );

where _Z18__spirv_ocl_printfPU3AS4Kcz demangles to __spirv_ocl_printf(char const AS4*, ...).

The same kernel compiles and runs with the OpenCL backend.

In case it's useful, the way I am using printf in kernel code is here and e.g. here.

The code compiles for the CUDA backend if I comment out the call to cl::sycl::intel::experimental::printf.

@fwyzard
Copy link
Contributor Author

fwyzard commented Feb 20, 2020

@Alexander-Johnston FYI

@AlexeySachkov AlexeySachkov added bug Something isn't working cuda CUDA back-end labels Feb 20, 2020
@Ruyk
Copy link
Contributor

Ruyk commented Feb 21, 2020

Thats an (undocumented?) intel extension, currently we are only implementing conformant SYCL features. We may do this later on if we have time.

@Ruyk
Copy link
Contributor

Ruyk commented Feb 21, 2020

@bader There is no extension document for this feature?

@bader
Copy link
Contributor

bader commented Feb 21, 2020

@AlexeySachkov, could add documentation for the feature you added by #835 to https://github.com/intel/llvm/tree/sycl/sycl/doc/extensions, please?

@Ruyk Ruyk added the libclc libclc project related issues label Mar 20, 2020
@Ruyk
Copy link
Contributor

Ruyk commented Jun 8, 2020

Is this still a problem @fwyzard ?

@jeffhammond
Copy link
Contributor

jeffhammond commented Oct 9, 2020

@Ruyk It's a problem for me today with the latest version.

@vrpascuzzi
Copy link

@Ruyk And me today with sycl-nightly/20210330. (@jeffhammond I swear, I'm not trolling your posts. Rather, seem to be some months behind you.)

jchlanda added a commit to jchlanda/llvm that referenced this issue Aug 13, 2021
Use `::printf` when not compiling for `__SPIR__`, this allows the use of
`EmitNVPTXDevicePrintfCallExpr` which packs the var args and dispatches
to CUDA's `vprintf`.

Fixes intel#1154
bader pushed a commit that referenced this issue Aug 17, 2021
Use `::printf` when not compiling for `__SPIR__`, this allows the use of
`EmitNVPTXDevicePrintfCallExpr` which packs the var args and dispatches
to CUDA's `vprintf`.

Fixes #1154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cuda CUDA back-end libclc libclc project related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants