Skip to content

Commit

Permalink
Add initialization to workaround threadfence issues in compute-saniti…
Browse files Browse the repository at this point in the history
…zer initcheck
  • Loading branch information
matthewdcong committed Sep 18, 2024
1 parent cc54b80 commit 20c5687
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions warp/native/bvh.cu
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,9 @@ void bvh_create_device(void* context, vec3* lowers, vec3* uppers, int num_items,
bvh_host.num_items = num_items;
bvh_host.max_nodes = 2*num_items;
bvh_host.node_lowers = (BVHPackedNodeHalf*)alloc_device(WP_CURRENT_CONTEXT, sizeof(BVHPackedNodeHalf)*bvh_host.max_nodes);
memset_device(WP_CURRENT_CONTEXT, bvh_host.node_lowers, 0, sizeof(BVHPackedNodeHalf)*bvh_host.max_nodes);
bvh_host.node_uppers = (BVHPackedNodeHalf*)alloc_device(WP_CURRENT_CONTEXT, sizeof(BVHPackedNodeHalf)*bvh_host.max_nodes);
memset_device(WP_CURRENT_CONTEXT, bvh_host.node_uppers, 0, sizeof(BVHPackedNodeHalf)*bvh_host.max_nodes);
bvh_host.node_parents = (int*)alloc_device(WP_CURRENT_CONTEXT, sizeof(int)*bvh_host.max_nodes);
bvh_host.node_counts = (int*)alloc_device(WP_CURRENT_CONTEXT, sizeof(int)*bvh_host.max_nodes);
bvh_host.root = (int*)alloc_device(WP_CURRENT_CONTEXT, sizeof(int));
Expand Down

0 comments on commit 20c5687

Please sign in to comment.