Bridging the Gap: Writing Portable Programs for CPU and GPU#define CUDATAGS 3 #ifndef 4 #define HST 5 #define DEV 6 #else 7 #define HST __host__ 8 #define DEV __device__ 9 #endif 10 #endif 11 12 HST DEV 13 void func () {} � �24/66 Motivation Patterns The dark path Cuda proposal Thank you host device template - Solution � � 1 enum class HDC { Hst , Dev , HstDev }; 2 3 #define MACRO( targ_ , hdc_ , func_ ) \ 4 template < targ_ , HDC x = hdc_ > requires( requires( x == HDC::Hst ) \ 5 __host__ func_ \ 6 template < targ_ , HDC x = hdc_ > requires( x == HDC::Dev ) \ 7 __device__ func_ \ 8 template < targ_ , HDC x = hdc_ > requires( x == HDC:: HstDev ) \ 9 __host__0 码力 | 124 页 | 4.10 MB | 6 月前3
Making Libraries Consumable for Non-C++ Developers/* Opens the device with name ‘dev’. On failure to open, returns SIZE_MAX. */ size_t open_device(char const* dev); size_t open_device(std::wstring_view const dev); The types char and wchar_t do has memory implications. More on that later.What assumptions are being made? void get_size(size_t dev, long* size); Non-C/C++ language. Caller of get_size(). C/C++ binary. Provides get_size(). gcc struct data_t { int a; int b; }; /* Get data from device ‘dev’. */ data_t get_data_from(size_t dev); What defines how dev is passed or data_t is returned? Calling conventions… sigh. Which0 码力 | 29 页 | 1.21 MB | 6 月前3
Conan 1.16 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.2 Creating conan packages to install dev tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 8.3 Build requirements . . packages directly from these source and build folders, though conan package is still recommended in the dev-flow to debug the package() method. • Using the package-folder argument (incompatible with the above but at the same time they want to work on cool/version@user/dev library which is tightly coupled to the app. The package cool/version@user/dev is already working, the developer has the sources in a local0 码力 | 545 页 | 4.34 MB | 1 年前3
Conan 1.15 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . 93 8.2 Creating conan packages to install dev tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 8.3 Build requirements . . packages directly from these source and build folders, though conan package is still recommended in the dev-flow to debug the package() method. • Using the package-folder argument (incompatible with the above but at the same time they wants to work on cool/version@user/dev library which is tightly coupled to the app. The package cool/version@user/dev is already working, the developer has the sources in a local0 码力 | 540 页 | 4.22 MB | 1 年前3
Conan 1.12 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . 87 8.2 Creating conan packages to install dev tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.3 Build requirements . . packages directly from these source and build folders, though conan package is still recommended in the dev-flow to debug the package() method. • Using the package-folder argument (incompatible with the above but at the same time they wants to work on cool/version@user/dev library which is tightly coupled to the app. The package cool/version@user/dev is already working, the developer has the sources in a local0 码力 | 505 页 | 4.10 MB | 1 年前3
Conan 1.13 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . 93 8.2 Creating conan packages to install dev tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 8.3 Build requirements . . packages directly from these source and build folders, though conan package is still recommended in the dev-flow to debug the package() method. • Using the package-folder argument (incompatible with the above but at the same time they wants to work on cool/version@user/dev library which is tightly coupled to the app. The package cool/version@user/dev is already working, the developer has the sources in a local0 码力 | 518 页 | 4.14 MB | 1 年前3
Conan 1.14 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . 93 8.2 Creating conan packages to install dev tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 8.3 Build requirements . . packages directly from these source and build folders, though conan package is still recommended in the dev-flow to debug the package() method. • Using the package-folder argument (incompatible with the above but at the same time they wants to work on cool/version@user/dev library which is tightly coupled to the app. The package cool/version@user/dev is already working, the developer has the sources in a local0 码力 | 528 页 | 4.17 MB | 1 年前3
Conan 1.18 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . 89 8.2 Creating conan packages to install dev tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 8.3 Build requirements . . packages directly from these source and build folders, though conan package is still recommended in the dev-flow to debug the package() method. • Using the package-folder argument (incompatible with the above but at the same time they want to work on cool/version@user/dev library which is tightly coupled to the app. The package cool/version@user/dev is already working, the developer has the sources in a local0 码力 | 584 页 | 4.80 MB | 1 年前3
Spanny 2: Rise of std::mdspankinematic model of robot arm */; auto arbiter = arbiter_single{left_arm, std::make_unique("/dev/ttyACM0")}; auto bin_checker = bin_checker_t{&arbiter}; auto bins = bin_view_t(bin_positions.data() arbiter = arbiter_dual{left_arm, std::make_unique ("/dev/ttyACM0"), right_arm, std::make_unique ("/dev/ttyACM1")}; auto bin_checker = bin_checker_t{&arbiter}; arbiter = arbiter_dual_async{left_arm, std::make_unique ("/dev/ttyACM0"), right_arm,std::make_unique ("/dev/ttyACM1"), bin_grid}; auto 0 码力 | 117 页 | 2.02 MB | 6 月前3
Conan 1.19 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.2 Creating conan packages to install dev tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 8.3 Build requirements . . packages directly from these source and build folders, though conan package is still recommended in the dev-flow to debug the package() method. • Using the package-folder argument (incompatible with the above but at the same time they want to work on cool/version@user/dev library which is tightly coupled to the app. The package cool/version@user/dev is already working, the developer has the sources in a local0 码力 | 609 页 | 4.88 MB | 1 年前3
共 130 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13













