printf question

Offen
#675 0 Kommentare 0 Reaktionen 2 zugewiesene Personen Auf GitHub ansehen

@xmnboy arbeitet bereits daran.

Seit 29.10.2021.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

question

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;

Vorherrschende Sprache
C++
Sterne
1.2k
Forks
745
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus oneapi-src/oneAPI-samples

Alle Issues in oneapi-src/oneAPI-samples

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.