有没有办法从 Math.sin() 或类似的 class 中获取 32 位(浮点)值,也许像 Math.sin(float a)

Is there a way to get 32 bit (float) values out of Math.sin() or a similar class, maybe smth like Math.sin(float a)

我正在尝试在 java 中使用我的 GPU,我正在使用 Aparapi,但我有一个问题,如果我使用 (float)Math.sin(x) 它仍然会退回到 CPU 因为我的 GPU 不支持 F64。有浮点数的数学库吗?我应该使用 gpu 来计算 sins 吗?

我希望像这样的项目带有自己的数学例程,以便您可以调用在 GPU 上实现的函数。

确实如此:Kernel.sin(float) 在 Aparapi 中应该 map to a call to the OpenCL sin function

在GPU上做trig是否有意义,就由你来评估了。