Skip to content

Cleaning up HAL buffer transfer usage.#8556

Merged
benvanik merged 5 commits intomainfrom
benvanik-buffer-usage
Mar 16, 2022
Merged

Cleaning up HAL buffer transfer usage.#8556
benvanik merged 5 commits intomainfrom
benvanik-buffer-usage

Conversation

@benvanik
Copy link
Copy Markdown
Collaborator

This cleans up places using the iree_hal_buffer_* API in an effort to move more toward device-based transfers. In order to make the requirement of the buffer functions acting on mappable buffers more explicit "map" was added to their name.

@benvanik benvanik added hal/api IREE's public C hardware abstraction layer API cleanup 🧹 labels Mar 15, 2022
@benvanik benvanik force-pushed the benvanik-buffer-usage branch from ccc5876 to 98304d2 Compare March 15, 2022 23:58
@benvanik benvanik marked this pull request as ready for review March 16, 2022 02:40
Copy link
Copy Markdown
Member

@ScottTodd ScottTodd left a comment

Choose a reason for hiding this comment

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

Thanks!

@benvanik
Copy link
Copy Markdown
Collaborator Author

Failing test was the asan flake in scalar.mlir.

@benvanik benvanik merged commit c1d6af3 into main Mar 16, 2022
@benvanik benvanik deleted the benvanik-buffer-usage branch March 16, 2022 19:14
Comment on lines 223 to 228
status = iree_hal_cuda_buffer_wrap(
(iree_hal_allocator_t*)allocator, memory_type, params->access,
allocator->base_device, base_allocator, memory_type, params->access,
params->usage, allocation_size,
/*byte_offset=*/0,
/*byte_length=*/allocation_size, device_ptr, host_ptr, &buffer);
Copy link
Copy Markdown
Member

@ScottTodd ScottTodd Mar 16, 2022

Choose a reason for hiding this comment

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

compile error caught on postsubmit:

../iree/hal/cuda/cuda_allocator.c:228:64: error: too many arguments to function call, expected 10, have 11
        /*byte_length=*/allocation_size, device_ptr, host_ptr, &buffer);
                                                               ^~~~~~~
../iree/hal/cuda/cuda_buffer.h:19:1: note: 'iree_hal_cuda_buffer_wrap' declared here
iree_status_t iree_hal_cuda_buffer_wrap(
^

(full logs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I just hit the same issue when building IREE with dbg mode.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sent a proposed fix: #8566

ScottTodd added a commit that referenced this pull request Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup 🧹 hal/api IREE's public C hardware abstraction layer API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants