The Diamonds

Pages

  • Home
  • Shop on Amazon

Tuesday, 29 November 2016

Printf works in CUDA

In order to execute the printf("something") in cuda code, we need to compile the code with an extra parameter i.e. [-arch=sm_20] which enables us to print our output inside cuda kernel.
for example i have my hello.cu file. The following command is use to compile the code.

nvcc -arch=sm_20 -o hello hello.cu

for complete documentation you can follow the link

http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#formatted-output





Posted by Shahzeb Khan at 19:00 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Flattr this blog

Blog Archive

  • ►  2025 (1)
    • ►  March (1)
  • ►  2024 (4)
    • ►  August (1)
    • ►  May (1)
    • ►  April (2)
  • ►  2023 (1)
    • ►  May (1)
  • ►  2022 (1)
    • ►  December (1)
  • ►  2021 (4)
    • ►  September (1)
    • ►  August (2)
    • ►  June (1)
  • ►  2020 (1)
    • ►  April (1)
  • ►  2019 (1)
    • ►  February (1)
  • ▼  2016 (3)
    • ▼  November (1)
      • Printf works in CUDA
    • ►  October (2)
  • ►  2015 (2)
    • ►  September (1)
    • ►  April (1)
  • ►  2014 (5)
    • ►  October (1)
    • ►  August (1)
    • ►  January (3)
  • ►  2013 (3)
    • ►  December (1)
    • ►  November (1)
    • ►  July (1)
  • ►  2012 (6)
    • ►  November (1)
    • ►  June (2)
    • ►  May (2)
    • ►  March (1)
Powered by Blogger.