How to use math functions in dcompute?

Nicholas Wilson iamthewilsonator at hotmail.com
Wed Sep 19 00:22:44 UTC 2018


On Wednesday, 19 September 2018 at 00:11:13 UTC, Nicholas Wilson 
wrote:
> On Tuesday, 18 September 2018 at 06:25:33 UTC, Sobaya wrote:
>> On Tuesday, 18 September 2018 at 01:39:51 UTC, Nicholas Wilson 
>> wrote:
>>> On Tuesday, 18 September 2018 at 00:25:33 UTC, Sobaya wrote:
>>>> I'm waiting for the update. How's your progress?
>>>
>>> I t appears I have broke SPIR-V completely somewhere along 
>>> the line, I may release a v0.2 with out it, hopefully within 
>>> the week.
>>
>> I declared like:
>>
>> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
>> T cos(T)(T val)
>>     if (__traits(isFloating, T));
>>
>> It also doesn't work.
>
>  pragma(LDC_intrinsic, "llvm.nvvm.cos.f#") // note the # in 
> place of 32
> T cos(T)(T val)
>      if (__traits(isFloating, T));
> (Just don't use real with it.)
>
> OR
>
> pragma(LDC_intrinsic, "llvm.nvvm.cos.f32")
>  float cos(float val)

And if they don't work, use

>  pragma(LDC_intrinsic, "llvm.cos.f#") // note the # in place of 
> 32
> T cos(T)(T val)
>      if (__traits(isFloating, T));
> (Just don't use real with it.)
>


More information about the Digitalmars-d-learn mailing list