torch / cutorch

A CUDA backend for Torch7
Other
337 stars 208 forks source link

How to create a new CudaTensor of type accreal in c code? #805

Open mbcel opened 6 years ago

mbcel commented 6 years ago

I am implementing my own module with a cuda kernel. In the kernel I want to add up a specific value globally and so I need to pass a THCTensor of type accreal into the cuda kernel function.

Now I am wondering how I can create a new THCTensor inside the C calling function that is of type accreal instead of real?

Can I do this like this somehow?

accrealTensor = THCTensor_(new)(state, realTensor);