Skip to content

Conduit Device Support#1358

Open
JustinPrivitera wants to merge 159 commits intodevelopfrom
task/JustinPrivitera/05_01_24/device_support
Open

Conduit Device Support#1358
JustinPrivitera wants to merge 159 commits intodevelopfrom
task/JustinPrivitera/05_01_24/device_support

Conversation

@JustinPrivitera
Copy link
Copy Markdown
Member

@JustinPrivitera JustinPrivitera commented Jan 24, 2025

Resolves #1358

Comment thread src/libs/conduit/conduit_config.h.in
@JustinPrivitera
Copy link
Copy Markdown
Member Author

Running on device performance annotations:

[ RUN      ] conduit_execution.strawman_data_accessor_src_host_des_host
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 727]
 data_accessor sync policy=host src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %   
use_with      0.000013      0.000013      0.000013 1.035794 
forall        0.000002      0.000002      0.000002 0.178694 
sync          0.000000      0.000000      0.000000 0.026093 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 758]
 data_accessor sync policy=device src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000045      0.000045      0.000045 42.418154 
forall        0.000022      0.000022      0.000022 20.814752 
sync          0.000009      0.000009      0.000009  8.665772 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 788]
 data_accessor assume policy=host src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %   
use_with      0.000004      0.000004      0.000004 9.062827 
forall        0.000001      0.000001      0.000001 3.446427 
assume        0.000000      0.000000      0.000000 0.740344 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 819]
 data_accessor assume policy=device src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000032      0.000032      0.000032 36.137612 
forall        0.000022      0.000022      0.000022 24.247576 
assume        0.000005      0.000005      0.000005  5.547416 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 849]
 data_accessor active_space src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %   
use_with      0.000002      0.000002      0.000002 5.671215 
forall        0.000001      0.000001      0.000001 2.981023 
sync          0.000000      0.000000      0.000000 0.557427 
[       OK ] conduit_execution.strawman_data_accessor_src_host_des_host (20 ms)
[ RUN      ] conduit_execution.strawman_data_accessor_src_device_des_device
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 896]
 data_accessor sync policy=host src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000031      0.000031      0.000031 43.576911 
forall        0.000001      0.000001      0.000001  0.936657 
sync          0.000009      0.000009      0.000009 12.106639 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 930]
 data_accessor sync policy=device src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000002      0.000002      0.000002  4.267349 
forall        0.000022      0.000022      0.000022 39.046247 
sync          0.000000      0.000000      0.000000  0.515638 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 964]
 data_accessor assume policy=host src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000031      0.000031      0.000031 48.288204 
forall        0.000001      0.000001      0.000001  1.042639 
assume        0.000001      0.000001      0.000001  0.871460 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 998]
 data_accessor assume policy=device src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000002      0.000002      0.000002  4.347748 
forall        0.000022      0.000022      0.000022 39.650743 
assume        0.000000      0.000000      0.000000  0.503045 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1031]
 data_accessor active_space src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000002      0.000002      0.000002  2.706205 
forall        0.000023      0.000023      0.000023 38.510111 
sync          0.000000      0.000000      0.000000  0.475636 
[       OK ] conduit_execution.strawman_data_accessor_src_device_des_device (17 ms)
[ RUN      ] conduit_execution.strawman_data_accessor_src_host_des_device
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1083]
 data_accessor sync policy=host src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 33.800324 
forall        0.000001      0.000001      0.000001  1.017549 
sync          0.000009      0.000009      0.000009 13.744286 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1115]
 data_accessor sync policy=device src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 30.835658 
forall        0.000019      0.000019      0.000019 25.773881 
sync          0.000000      0.000000      0.000000  0.345423 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1147]
 data_accessor assume policy=host src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000024      0.000024      0.000024 41.008198 
forall        0.000001      0.000001      0.000001  1.203558 
assume        0.000001      0.000001      0.000001  0.941915 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1179]
 data_accessor assume policy=device src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 29.926998 
forall        0.000020      0.000020      0.000020 26.505102 
assume        0.000000      0.000000      0.000000  0.376032 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1210]
 data_accessor active_space src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000022      0.000022      0.000022 32.417005 
forall        0.000001      0.000001      0.000001  0.991438 
sync          0.000009      0.000009      0.000009 14.015322 
[       OK ] conduit_execution.strawman_data_accessor_src_host_des_device (17 ms)
[ RUN      ] conduit_execution.strawman_data_accessor_src_device_des_host
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1260]
 data_accessor sync policy=host src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000024      0.000024      0.000024 41.360101 
forall        0.000001      0.000001      0.000001  1.138304 
sync          0.000000      0.000000      0.000000  0.482917 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1292]
 data_accessor sync policy=device src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 26.763990 
forall        0.000019      0.000019      0.000019 22.451309 
sync          0.000010      0.000010      0.000010 10.989264 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1324]
 data_accessor assume policy=host src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000024      0.000024      0.000024 41.146114 
forall        0.000001      0.000001      0.000001  1.077305 
assume        0.000000      0.000000      0.000000  0.364894 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1356]
 data_accessor assume policy=device src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000031      0.000031      0.000031 36.780463 
forall        0.000020      0.000020      0.000020 23.142552 
assume        0.000001      0.000001      0.000001  0.844961 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1388]
 data_accessor active_space src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000022      0.000022      0.000022 26.054129 
forall        0.000020      0.000020      0.000020 22.964340 
sync          0.000009      0.000009      0.000009 10.198629 
[       OK ] conduit_execution.strawman_data_accessor_src_device_des_host (22 ms)
[ RUN      ] conduit_execution.strawman_data_array_src_host_des_host
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1432]
 data_array sync policy=host src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %   
use_with      0.000004      0.000004      0.000004 8.085955 
forall        0.000001      0.000001      0.000001 2.171023 
sync          0.000000      0.000000      0.000000 0.465219 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1463]
 data_array sync policy=device src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000033      0.000033      0.000033 33.707297 
forall        0.000021      0.000021      0.000021 21.709441 
sync          0.000010      0.000010      0.000010  9.711586 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1493]
 data_array assume policy=host src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %   
use_with      0.000003      0.000003      0.000003 8.227539 
forall        0.000001      0.000001      0.000001 2.856445 
assume        0.000000      0.000000      0.000000 0.561523 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1524]
 data_array assume policy=device src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000033      0.000033      0.000033 37.082169 
forall        0.000021      0.000021      0.000021 23.655674 
assume        0.000001      0.000001      0.000001  0.827278 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1554]
 data_array active_space src_start=host des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %   
use_with      0.000002      0.000002      0.000002 4.530120 
forall        0.000001      0.000001      0.000001 2.746988 
sync          0.000000      0.000000      0.000000 0.602410 
[       OK ] conduit_execution.strawman_data_array_src_host_des_host (17 ms)
[ RUN      ] conduit_execution.strawman_data_array_src_device_des_device
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1601]
 data_array sync policy=host src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000032      0.000032      0.000032 42.392871 
forall        0.000001      0.000001      0.000001  0.825580 
sync          0.000009      0.000009      0.000009 11.610536 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1635]
 data_array sync policy=device src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000002      0.000002      0.000002  4.031381 
forall        0.000022      0.000022      0.000022 37.620649 
sync          0.000000      0.000000      0.000000  0.485104 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1669]
 data_array assume policy=host src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000050      0.000050      0.000050 57.448847 
forall        0.000001      0.000001      0.000001  0.738595 
assume        0.000001      0.000001      0.000001  0.623190 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1703]
 data_array assume policy=device src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000002      0.000002      0.000002  3.984785 
forall        0.000023      0.000023      0.000023 37.295615 
assume        0.000000      0.000000      0.000000  0.477516 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1736]
 data_array active_space src_start=device des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000002      0.000002      0.000002  2.745596 
forall        0.000024      0.000024      0.000024 38.676401 
sync          0.000000      0.000000      0.000000  0.460244 
[       OK ] conduit_execution.strawman_data_array_src_device_des_device (17 ms)
[ RUN      ] conduit_execution.strawman_data_array_src_host_des_device
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1788]
 data_array sync policy=host src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000024      0.000024      0.000024 34.119339 
forall        0.000001      0.000001      0.000001  0.920201 
sync          0.000009      0.000009      0.000009 13.515457 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1820]
 data_array sync policy=device src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 20.982372 
forall        0.000020      0.000020      0.000020 17.556476 
sync          0.000000      0.000000      0.000000  0.251706 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1852]
 data_array assume policy=host src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000024      0.000024      0.000024 38.849937 
forall        0.000001      0.000001      0.000001  1.018046 
assume        0.000001      0.000001      0.000001  0.886685 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1884]
 data_array assume policy=device src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 29.426559 
forall        0.000020      0.000020      0.000020 24.597586 
assume        0.000000      0.000000      0.000000  0.364688 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1915]
 data_array active_space src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 31.930885 
forall        0.000001      0.000001      0.000001  0.847685 
sync          0.000009      0.000009      0.000009 13.322784 
[       OK ] conduit_execution.strawman_data_array_src_host_des_device (17 ms)
[ RUN      ] conduit_execution.strawman_data_array_src_device_des_host
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1965]
 data_array sync policy=host src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000024      0.000024      0.000024 39.098698 
forall        0.000001      0.000001      0.000001  0.991693 
sync          0.000000      0.000000      0.000000  0.406431 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1997]
 data_array sync policy=device src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 26.141669 
forall        0.000020      0.000020      0.000020 22.111262 
sync          0.000010      0.000010      0.000010 11.240358 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 2029]
 data_array assume policy=host src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000024      0.000024      0.000024 38.297189 
forall        0.000001      0.000001      0.000001  0.915663 
assume        0.000000      0.000000      0.000000  0.433735 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 2061]
 data_array assume policy=device src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000023      0.000023      0.000023 29.137909 
forall        0.000019      0.000019      0.000019 24.444723 
assume        0.000001      0.000001      0.000001  0.928598 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 2093]
 data_array active_space src_start=device des_start=host
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.000022      0.000022      0.000022 25.129777 
forall        0.000020      0.000020      0.000020 22.257156 
sync          0.000009      0.000009      0.000009  9.772565 
[       OK ] conduit_execution.strawman_data_array_src_device_des_host (17 ms)

@JustinPrivitera
Copy link
Copy Markdown
Member Author

JustinPrivitera commented Apr 22, 2026

Running with much larger arrays, src starting on host des starting on device

[ RUN      ] conduit_execution.strawman_data_accessor_src_host_des_device
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1079]
 data_accessor sync policy=host src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.001430      0.001430      0.001430  1.311628 
forall        0.106097      0.106097      0.106097 97.336826 
sync          0.001413      0.001413      0.001413  1.296252 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1107]
 data_accessor sync policy=device src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.008063      0.008063      0.008063 98.000095 
forall        0.000116      0.000116      0.000116  1.414218 
sync          0.000000      0.000000      0.000000  0.003525 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1135]
 data_accessor assume policy=host src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.001418      0.001418      0.001418  1.348748 
forall        0.103654      0.103654      0.103654 98.604876 
assume        0.000001      0.000001      0.000001  0.001389 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1163]
 data_accessor assume policy=device src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.007959      0.007959      0.007959 98.013778 
forall        0.000115      0.000115      0.000115  1.415281 
assume        0.000000      0.000000      0.000000  0.003941 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1190]
 data_accessor active_space src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.001423      0.001423      0.001423  1.318741 
forall        0.105016      0.105016      0.105016 97.324327 
sync          0.001414      0.001414      0.001414  1.310595 
[       OK ] conduit_execution.strawman_data_accessor_src_host_des_device (1106 ms)


// Compute face centers and normals.
conduit::execution::for_all<ExecPolicy>(0, totalNumFaces, [=](conduit::index_t f) {
conduit::execution::forall<ExecPolicy>(0, totalNumFaces, [=](conduit::index_t f) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused by this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wherever this method is called, we want to take a look at the template and consider switching to a policy object choice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look into RDC before getting Cyrus' blessing

Comment thread src/libs/conduit/conduit_execution.cpp
Comment thread src/libs/conduit/conduit_execution.cpp
Comment thread src/libs/conduit/conduit_execution.cpp
bool
ExecutionPolicy::is_parallel_policy() const
{
return is_cuda() || is_hip() || is_openmp();
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to look at in the future - we don't have consistency here.

You can create a "parallel" exec policy that is_parallel_policy() returns false for. We should make a ticket to examine in the future.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a note in the code too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the note in the code; we just need a ticket with follow-on work now.

};

//-----------------------------------------------------------------------------
void init_device_memory_handlers();
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a static function that people only have to do once. We should have a conduit utility somewhere that should be able to do this somewhere. It should see if the handlers are installed and do it, otherwise do nothing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be a TODO for later

Comment thread src/libs/conduit/conduit_execution.hpp
Comment thread src/libs/conduit/conduit_execution_core.hpp
Comment thread src/libs/conduit/conduit_execution_core.hpp
Comment on lines +22 to +47
// Build capability answers "was this Conduit build configured with a RAJA
// backend?", while TU capability answers "is this translation unit actually
// being compiled with that device compiler right now?"
#if defined(CONDUIT_USE_RAJA) && defined(CONDUIT_USE_CUDA)
#define CONDUIT_EXEC_BUILD_HAS_CUDA
#endif

#if defined(CONDUIT_USE_RAJA) && defined(CONDUIT_USE_HIP)
#define CONDUIT_EXEC_BUILD_HAS_HIP
#endif

#if defined(CONDUIT_EXEC_BUILD_HAS_CUDA) || defined(CONDUIT_EXEC_BUILD_HAS_HIP)
#define CONDUIT_EXEC_BUILD_HAS_DEVICE
#endif

#if defined(CONDUIT_EXEC_BUILD_HAS_CUDA) && defined(__CUDACC__)
#define CONDUIT_EXEC_TU_HAS_CUDA
#endif

#if defined(CONDUIT_EXEC_BUILD_HAS_HIP) && defined(__HIPCC__)
#define CONDUIT_EXEC_TU_HAS_HIP
#endif

#if defined(CONDUIT_EXEC_TU_HAS_CUDA) || defined(CONDUIT_EXEC_TU_HAS_HIP)
#define CONDUIT_EXEC_TU_HAS_DEVICE
#endif
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codex disaster

we will never have to worry about cuda or hip
we have duplicated this in the conduit_execution.hpp header
we want to use what is there and not have all this madness

Comment on lines +454 to +481
inline void
validate_runtime_policy(const ExecutionPolicy &policy,
const char *context)
{
if (policy.is_empty())
{
CONDUIT_ERROR(context << " does not support an empty policy.");
}

if (policy.is_openmp())
{
#if !defined(CONDUIT_USE_OPENMP)
CONDUIT_ERROR(context << " requires OpenMP support in this translation unit.");
#endif
}
else if (policy.is_cuda())
{
#if !defined(CONDUIT_EXEC_TU_HAS_CUDA)
CONDUIT_ERROR(context << " requires CUDA support in this translation unit.");
#endif
}
else if (policy.is_hip())
{
#if !defined(CONDUIT_EXEC_TU_HAS_HIP)
CONDUIT_ERROR(context << " requires HIP support in this translation unit.");
#endif
}
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this and these strange ifdefs. Why do we need this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't the policy creation fail? shouldn't it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime error for compile errors is strange. We should find a way to error earlier if someone wants to run on a GPU and we can't.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not clear we need to validate like this right now.

Comment thread src/tests/conduit/t_conduit_execution.cpp
#if defined(CONDUIT_USE_OPENMP)
detail::ReduceSumImpl<OpenMPExec, T> m_openmp_reduce;
#endif
#if defined(CONDUIT_EXEC_TU_HAS_CUDA)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name is not great :/

@JustinPrivitera
Copy link
Copy Markdown
Member Author

use hatchet/thicket to compare speedup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants