小编Wes*_*ger的帖子

对于CUDA,是否可以保证三元运营商可以避免分支差异?

我已经阅读了很多关于CUDA分支差异的线索,告诉我使用三元运算符比if/else语句更好,因为三元运算符不会导致分支分歧.我想知道,对于以下代码:

foo = (a > b) ? (bar(a)) : (b);
Run Code Online (Sandbox Code Playgroud)

如果bar是另一个函数或更复杂的语句,那么是否仍然没有分支差异?

cuda

5
推荐指数
2
解决办法
1628
查看次数

有什么方法可以让gmsh在材质边界的两边使用相同的顶点集?

我试图对由3种材料组成的复杂几何进行网格划分,如下所示:

在此输入图像描述

几何从*.stp文件导入.

我在地理文件中定义了几个物理表面和3个物理域:

Physical Surface("air-case", 1) = {50, 42, 41, 40, 48};
Physical Surface("case-thermal", 2) = {32, 15, 22, 21, 25};
Physical Surface("thermal-grain", 3) = {2, 7, 6};
Physical Surface("thermal-fluid", 4) = {30, 27};
Physical Surface("burning", 5) = {3, 4, 5, 10, 13, 9, 11, 12};

Physical Surface("case-sym", 11) = {49, 51, 34, 43, 44, 47};
Physical Surface("thermal-sym", 12) = {24, 28, 14, 23, 29, 33};
Physical Surface("grain-sym", 13) = {8, 1};

Physical Volume("case", 1) = {6, 5, 7};
Physical …
Run Code Online (Sandbox Code Playgroud)

numeric mesh numerical-methods finite-element-analysis

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