course icon indicating copy to clipboard operation
course copied to clipboard

高性能并行编程与优化 - 课件

Results 21 course issues
Sort by recently updated
recently updated
newest added

环境:ubuntu22.04 gcc:9 运行时出现/usr/include/c++/9/bits/stl_vector.h(130): error: no instance of constructor "CudaAllocator::CudaAllocator [with T=float]" matches the argument list detected during instantiation of "std::_Vector_base::_Vector_impl::_Vector_impl() [with _Tp=float, _Alloc=CudaAllocator]" (337): here 这个问题

以下代码不适用于clang15+msvc(vs2022)的情形 ``` #if defined(_MSC_VER) size_t pos = s.find(','); pos += 1; size_t pos2 = s.find('>', pos); #else ``` 在执行这一段前,s的值为:`"const char *__cdecl 函数名 [T = 枚举, N = 枚举::枚举常量]"` 我现在改为以下代码可以正常使用: ```...

08/06_thrust/01/main.cu文件里面`include `显示找不到 官方thrust库里面的"universal_allocator.h", "universal_ptr.h", "universal_vector.h"都没有在我电脑cuda的include的文件夹里面。是我安装cuda有问题吗?(2022年安装的cuda)还是更新了吗?`#include #include `这些没有问题。

slides/thread/mtqueue.hpp中,std::optional try_pop_until函数中,使用的是m_cv_empty.wait_for而不是wait_until。

hi, 小彭老师好。关于 07/03_prefetch/06 例子运行结果我有一些疑问,望指正。 我的平台是 Intel i5-13500, Ubuntu 24.04, gcc version 13.2.0 在运行 07/03_prefetch/06 这个例子时, 去掉例子中的 #pragma omp parallel for 才能得到与课程中类似的结果。我不清楚 #pragma omp parallel for 是否除了并行之外还有其他的优化? # 原始版本运行结果 从运行结果可以看到,BM_write_stream_then_read 跟...

小彭老师好,《现代C++入门:RAII内存管理》一课中提到的:初始化列表妙用,解决函数多返回值,更加fancy的写法无法编译通过。 示例代码: struct {     bool b1;     double d1; } test_anoy() {     return {false, 1.0}; } 编译错误: test.cpp:9:1: error: new types may not be defined in a return type 9 |...

https://github.com/parallel101/course/blob/8c890ba00bc452af8d66c419a27998297378679e/slides/design/game.md?plain=1#L1000 修改为: ```cpp struct MoveMessage :Message{ glm::vec3 velocityChange; void accept(MessageVisitor *visitor) override { visitor->visit(this); // 会调用到 visit(MoveMessage *mm) 这个重载 } }; struct JumpMessage :Message{ double jumpHeight; void accept(MessageVisitor *visitor) override...