小编Sea*_*ean的帖子

为什么Math.cos(90*Math.PI/180)得到6.123031769111 ......而不是零?

我将度数转换为弧度(度*Math.PI/180),但为什么会出现以下情况:

Math.cos(90 * Math.PI/180)
Run Code Online (Sandbox Code Playgroud)

产量6.123031769111 ......而不是零?

我正在尝试使用矩阵执行2D旋转,结果完全没有问题.

javascript math geometry trigonometry

19
推荐指数
1
解决办法
1万
查看次数

cuda-gdb 是否会自动为 CUDA_EXCEPTION_5 Warp 超出范围地址错误选择正确的焦点?

我的内核因 CUDA_EXCEPTION_5、Warp 超出范围地址而失败。

cuda-gdb 自动将焦点放在特定块上。是发生错误的块还是当 nvidia 文档指出 CUDA_EXCEPTION_5“不精确”时,这意味着调试器无法确定特定异常发生在哪个块/线程中?

如果它只是针对扭曲,有没有办法在 cuda-gdb 中找出异常发生在哪个扭曲以及哪些块属于该扭曲?

debugging cuda exception

3
推荐指数
1
解决办法
1043
查看次数

具有多个.h和.cu文件的静态库无法解析函数

使用multiple.h和.cu文件编译静态库时,我得到一个未解析的extern函数.这是一个复制错误的简短示例.

看来我不能让Nsight Eclipse Edition先编译extrafunctions.cu.在我的整个项目有额外功能的文件编译第一,但它仍然抛出无法解决外部函数错误.

以下是此示例的输出:

**** Build of configuration Debug for project linkerror ****

make all 
Building file: ../cudatest.cu
Invoking: NVCC Compiler
nvcc -I/usr/local/cuda/include -G -g -O0 -gencode arch=compute_30,code=sm_30 -odir "" -M -o "cudatest.d" "../cudatest.cu"
nvcc --compile -G -I/usr/local/cuda/include -O0 -g -gencode arch=compute_30,code=compute_30 -gencode arch=compute_30,code=sm_30  -x cu -o  "cudatest.o" "../cudatest.cu"
../cudatest.cu(19): warning: variable "devInts" is used before its value is set

../cudatest.cu(19): warning: variable "devInts" is used before its value is set

ptxas fatal   : Unresolved extern function …
Run Code Online (Sandbox Code Playgroud)

c++ cuda header-files static-libraries unresolved-external

1
推荐指数
1
解决办法
2369
查看次数