已答复 C++ AMP: view generated HLSL code

  • Tuesday, February 14, 2012 2:15 AM
     
     

    Hi,

    Is there any way to see the generated HLSL code from a C++ AMP kernel ?

    Best regards, Arnaud.

All Replies

  • Wednesday, February 15, 2012 2:41 AM
    Owner
     
     Answered

    Hi Arnaud

    Unfortunately we don’t offer the capability to view the HLSL code.

    To be honest, the code we generate is very optimized, and is more like assembly code in both the level it describes things, names it uses and its structure. It is nowhere near the HLSL code that a human could write and indeed not something they could read without a lot of effort. It also is an implementation detail that we do not wish to expose.

    Was it just curiosity or did you have a specific scenario that you think the code would enable? If you had access to the HLSL bytecode, would that cater for your scenario?

    Cheers
    Daniel


    http://www.danielmoth.com/Blog/

    • Marked As Answer by Arnaud Faucher Wednesday, February 15, 2012 1:24 PM
    •  
  • Wednesday, February 15, 2012 1:24 PM
     
     

    Hi Daniel,

    It was for learning purposes, in order to understand better how to write efficient kernels. To make a parallel with .asm listings, after studying them, you write better code.

    Thanks for your reply, Arnaud.

  • Tuesday, December 11, 2012 10:00 PM
     
     

    It's possible to see kernel disassembly, it's not HLSL.  See Amit's reply in this thread:

    http://social.msdn.microsoft.com/Forums/hu/parallelcppnative/thread/7f2d0bc0-caa8-4475-af49-68aaf7b36252


    • Edited by greenkalx Tuesday, December 11, 2012 10:11 PM
    •