oneapi-src / oneapi-src/oneAPI-samples

printf question

Open
#675 0 comments 0 reactions 2 assignees View on GitHub

@xmnboy is already working on this.

Since Oct 29, 2021.

question
Dominant language
C++
Stars
1.2k
Forks
745
PR merge metrics
No merged PRs in 30d

Description

It is not clear why printf is not supported in DPC++. printf is supported in DPC++ with CUDA support.

Addressing Warnings in Migrated Code
Migration generated one warning for code that dpct could not migrate:

warning: DPCT1015:0: Output needs adjustment.
As you have noticed, the migration of this project resulted in one DPCT message that needs to be addressed, DPCT1015. This message is shown because as the Compatibility Tool migrated from the printf-style formatted string in the CUDA code to the output stream supported by DPC++, manual adjustment is needed to generate the equivalent output.

Open result/foo/bar/util.dp.cpp and locate the error DPCT1015. Then make the following changes:

Change:

stream_ct1 << "kernel_util,%d\n";
to

stream_ct1 << "kernel_util," << c << sycl::endl;
You’ll also need to change the stream statement in result/foo/main.dp.cpp.

Change:

stream_ct1 << z"kernel_main!\n";
to

stream_ct1 << "kernel_main!" << sycl::endl;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.