 C++高性能并行编程与优化 -  课件 - 09 CUDA C++ 流体仿真实战数组,不过是只读的。好处是他可以通过浮点坐标来访 问,且提供了线性滤波的能力。 • 在核函数中可以通过 tex3D 来读取纹理中的值。 • 之所以纹理是因为 GPU 一开始是渲染图形的专用硬件 ,会用到一些贴图等,这就是二维的纹理。 • 当输入的浮点坐标不是整数时,由 GPU 硬件提供双线 性插值( bilerp ),比手写的高效许多。 • 当然如果是三维数组,那就是三维纹理对象,访问时是 提供三线性插值(0 码力 | 58 页 | 14.90 MB | 1 年前3 C++高性能并行编程与优化 -  课件 - 09 CUDA C++ 流体仿真实战数组,不过是只读的。好处是他可以通过浮点坐标来访 问,且提供了线性滤波的能力。 • 在核函数中可以通过 tex3D 来读取纹理中的值。 • 之所以纹理是因为 GPU 一开始是渲染图形的专用硬件 ,会用到一些贴图等,这就是二维的纹理。 • 当输入的浮点坐标不是整数时,由 GPU 硬件提供双线 性插值( bilerp ),比手写的高效许多。 • 当然如果是三维数组,那就是三维纹理对象,访问时是 提供三线性插值(0 码力 | 58 页 | 14.90 MB | 1 年前3
 C++高性能并行编程与优化 -  课件 - 10 从稀疏数据结构到量化数据类型注意到我们的值始终是正数,因此可以用无符号的 uint8_t (可以容纳 0 到 255 ),然后把刚刚的系数 100 改小到 2 ,成功算对结果了,代价是精度损失了 不少。 • 其实 GPU 存储贴图一般也是用的定点数 uint8_t (范围从 0 到 255 ),着色器在读取的时候才会把他 转换成 float (范围从 0.0 到 1.0 )。这就是浮点数的 量化,存储时转换成低精度的定点数,读取时再转换0 码力 | 102 页 | 9.50 MB | 1 年前3 C++高性能并行编程与优化 -  课件 - 10 从稀疏数据结构到量化数据类型注意到我们的值始终是正数,因此可以用无符号的 uint8_t (可以容纳 0 到 255 ),然后把刚刚的系数 100 改小到 2 ,成功算对结果了,代价是精度损失了 不少。 • 其实 GPU 存储贴图一般也是用的定点数 uint8_t (范围从 0 到 255 ),着色器在读取的时候才会把他 转换成 float (范围从 0.0 到 1.0 )。这就是浮点数的 量化,存储时转换成低精度的定点数,读取时再转换0 码力 | 102 页 | 9.50 MB | 1 年前3
 C++高性能并行编程与优化 -  课件 - 15 C++ 系列课:字符与字符串3 字节才能存储。好处是这能完全兼容以前 const char * 的那套代码 ,包括 ‘ \0’ 结尾字符串都可以继续正常使用,不用全换到 wchar_t 里来。 小彭老师懒得讲了,直接粘贴图片好了 https://zhuanlan.zhihu.com/p/427488961 读写双方编码格式不同:会导致乱码 • 然而不同的编码格式之间并不兼容。 • 例如 GBK 规定“我”这个字对应的整数是0 码力 | 162 页 | 40.20 MB | 1 年前3 C++高性能并行编程与优化 -  课件 - 15 C++ 系列课:字符与字符串3 字节才能存储。好处是这能完全兼容以前 const char * 的那套代码 ,包括 ‘ \0’ 结尾字符串都可以继续正常使用,不用全换到 wchar_t 里来。 小彭老师懒得讲了,直接粘贴图片好了 https://zhuanlan.zhihu.com/p/427488961 读写双方编码格式不同:会导致乱码 • 然而不同的编码格式之间并不兼容。 • 例如 GBK 规定“我”这个字对应的整数是0 码力 | 162 页 | 40.20 MB | 1 年前3
 Julia v1.2.0 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1250 页 | 4.29 MB | 1 年前3 Julia v1.2.0 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1250 页 | 4.29 MB | 1 年前3
 Julia v1.1.1 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1216 页 | 4.21 MB | 1 年前3 Julia v1.1.1 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1216 页 | 4.21 MB | 1 年前3
 Julia 1.1.0 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1214 页 | 4.21 MB | 1 年前3 Julia 1.1.0 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1214 页 | 4.21 MB | 1 年前3
 Julia 1.2.0 DEV Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1252 页 | 4.28 MB | 1 年前3 Julia 1.2.0 DEV Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1252 页 | 4.28 MB | 1 年前3
 Julia v1.4.2 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While waiting for a free thread, and during function execution once a thread is available cond = Base.AsyncCondition() wait(cond) The callback you pass to C should only execute a ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any allocations or other interactions 336 CHAPTER 34. CALLING C AND FORTRAN CODE Note that events may be coalesced, so multiple calls to uv_async_send may result in a single wakeup notifi- cation to the condition. 34.15 More About Callbacks0 码力 | 1314 页 | 4.29 MB | 1 年前3 Julia v1.4.2 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While waiting for a free thread, and during function execution once a thread is available cond = Base.AsyncCondition() wait(cond) The callback you pass to C should only execute a ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any allocations or other interactions 336 CHAPTER 34. CALLING C AND FORTRAN CODE Note that events may be coalesced, so multiple calls to uv_async_send may result in a single wakeup notifi- cation to the condition. 34.15 More About Callbacks0 码力 | 1314 页 | 4.29 MB | 1 年前3
 Julia v1.3.1 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1276 页 | 4.36 MB | 1 年前3 Julia v1.3.1 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While wai�ng for a free thread, and during func�on execu�on once a thread is available ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any alloca�ons or other interac�ons with the Julia run�me. Note that events may be coalesced, so mul�ple calls to uv_async_send that wakes up tasks wai�ng for it (by calling wait on the object) when no�fied from C by a call to uv_async_send. Wai�ng tasks are woken with an error when the object is closed (by close. Use isopen to0 码力 | 1276 页 | 4.36 MB | 1 年前3
 Julia v1.5.4 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While waiting for a free thread, and during function execution once a thread is available cond = Base.AsyncCondition() wait(cond) The callback you pass to C should only execute a ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any allocations or other interactions 318 CHAPTER 27. CALLING C AND FORTRAN CODE Note that events may be coalesced, so multiple calls to uv_async_send may result in a single wakeup notifi- cation to the condition. 27.15 More About Callbacks0 码力 | 1337 页 | 4.41 MB | 1 年前3 Julia v1.5.4 Documentationdefault size of 4 is used for this. The size of the threadpool is controlled via environment variable UV_THREADPOOL_SIZE. While waiting for a free thread, and during function execution once a thread is available cond = Base.AsyncCondition() wait(cond) The callback you pass to C should only execute a ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any allocations or other interactions 318 CHAPTER 27. CALLING C AND FORTRAN CODE Note that events may be coalesced, so multiple calls to uv_async_send may result in a single wakeup notifi- cation to the condition. 27.15 More About Callbacks0 码力 | 1337 页 | 4.41 MB | 1 年前3
共 102 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11














