Hi all, in ptx a float constant is 0f???
Can I write a half2 constant?
Hi all, in ptx a float constant is 0f???
Can I write a half2 constant?
Half precision literals are not integrated into CUDA at the moment, but a ticket has in place.
In the meantime, you can use
static_cast<__half>(2.0)
What about at the ptx level?
I think the answer is still no.
At the ptx level, I believe it is possible to first mov a constant into a register, and then do the hfma instruction. Although not sure what the SASS would be like and if it will use the constant cache in this case.