How do I get CUDA's printf to print to an arbitrary stream?

einpoklum

CUDA's printf() in kernels prints to the standard output stream of my process. Now, I want to, at the least, redirect this printout to an arbitrary output stream , from here on. I do mean an arbitrary stream, that is not just a file descriptor (as is requested here) - I want to be able to use stringstreams, logging infrastructure etc.

If that's possible, what I would really like to be able to do something like tell a single kernel send its printf() output to some output stream. Is this possible?

Note: To the two kind souls which marked this a favorite question of theirs - how come you like my question enough to make it a favorite, but not enough to upvote it? < puzzled. >

talonmies

To the best of my knowledge, this isn't possible. The CUDA API doesn't provide any control over the IO stream to which the output will be emitted.

If you want something more elaborate than the facilities provided by the runtime, then your best solution is to roll your own. Before runtime support for in-kernel printf was added to CUDA, NVIDIA shipped (at least to developers) a utility called cuprintf which allowed kernels to emit output to the host console. My suggestion would be to grab the code for cuprintf and hack into doing what you are looking for.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I get CUDA's printf to print to an arbitrary stream?

From Dev

Are CUDA streams device-associated? And how do I get a stream's device?

From Dev

How do I print out every string in a char** to printf()?

From Dev

How do I print backslash followed by newline with printf?

From Dev

How do I print backslash followed by newline with printf?

From Dev

How do I accept arbitrary query parameters in a Restler GET request?

From Dev

Why do I need to include <stdio.h> to use CUDA's printf()?

From Dev

Why do I need to include <stdio.h> to use CUDA's printf()?

From Dev

How do I get a variable to print a string

From Dev

How do I get a variable to print a string

From Dev

How do I get Zlib to uncompress from S3 stream in Ruby?

From Dev

How do I get Zlib to uncompress from S3 stream in Ruby?

From Dev

How do I get Python's ElementTree to pretty print to an XML file?

From Dev

How do I run arbitrary SQL on DBeaver?

From Dev

How do I rotate an image by an arbitrary amount?

From Dev

SonarQube: How do I compare arbitrary versions?

From Dev

How do I implement rstrip for arbitrary strings?

From Dev

How do I get Google Drive to open text files with arbitrary extensions as text files?

From Dev

Stream.CopyTo - How do I get the sent Bytes?

From Dev

how do i get the mixlr radio stream to play in android app?

From Dev

How do i add a progress bar to a stream and get a response back

From Dev

How can I use scipy's affine_transform to do an arbitrary affine transformation on a color image?

From Dev

How do I get and print value of an environment variable?

From Dev

How do I get a callback function to print something only periodically?

From Dev

How do I get and print value of an environment variable?

From Dev

How do I get PHP to print the unescaped contents of a variable?

From Dev

How do I get this java error window to print out in this situation?

From Dev

How do I print the user's input (Array) in java?

From Java

How do I list, map and "print if count>0" with Java 8 / stream API?

Related Related

  1. 1

    How do I get CUDA's printf to print to an arbitrary stream?

  2. 2

    Are CUDA streams device-associated? And how do I get a stream's device?

  3. 3

    How do I print out every string in a char** to printf()?

  4. 4

    How do I print backslash followed by newline with printf?

  5. 5

    How do I print backslash followed by newline with printf?

  6. 6

    How do I accept arbitrary query parameters in a Restler GET request?

  7. 7

    Why do I need to include <stdio.h> to use CUDA's printf()?

  8. 8

    Why do I need to include <stdio.h> to use CUDA's printf()?

  9. 9

    How do I get a variable to print a string

  10. 10

    How do I get a variable to print a string

  11. 11

    How do I get Zlib to uncompress from S3 stream in Ruby?

  12. 12

    How do I get Zlib to uncompress from S3 stream in Ruby?

  13. 13

    How do I get Python's ElementTree to pretty print to an XML file?

  14. 14

    How do I run arbitrary SQL on DBeaver?

  15. 15

    How do I rotate an image by an arbitrary amount?

  16. 16

    SonarQube: How do I compare arbitrary versions?

  17. 17

    How do I implement rstrip for arbitrary strings?

  18. 18

    How do I get Google Drive to open text files with arbitrary extensions as text files?

  19. 19

    Stream.CopyTo - How do I get the sent Bytes?

  20. 20

    how do i get the mixlr radio stream to play in android app?

  21. 21

    How do i add a progress bar to a stream and get a response back

  22. 22

    How can I use scipy's affine_transform to do an arbitrary affine transformation on a color image?

  23. 23

    How do I get and print value of an environment variable?

  24. 24

    How do I get a callback function to print something only periodically?

  25. 25

    How do I get and print value of an environment variable?

  26. 26

    How do I get PHP to print the unescaped contents of a variable?

  27. 27

    How do I get this java error window to print out in this situation?

  28. 28

    How do I print the user's input (Array) in java?

  29. 29

    How do I list, map and "print if count>0" with Java 8 / stream API?

HotTag

Archive