This project is read-only.

Math functions

Jan 10, 2014 at 3:35 AM
Hi, is there any way to access the built in cuda math functions? for example expf(), _expf() and others. I have seen that the GMath's source have them commented out on the bottom. Also is it possible to just call it directly from my c# code without modifying gmath, and etc?
Jan 10, 2014 at 8:37 AM
GMath.Exp is already available.
You can always insert literal CUDA C code into a device function - see the user manual.
        private static void AHybridMethod(Cudafy.GThread thread, int[] data, int[] results)
            GThread.InsertCode("#pragma unroll 5");
            for (int h = 0; h < data.Length; h++)
                GThread.InsertCode("{0}[{2}] = {1}[{2}];", results, data, h);