Skip to content

[FPGA] Update zero_copy_kernel sample to support IP-Authoring #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

wangdi4
Copy link
Owner

@wangdi4 wangdi4 commented Sep 21, 2023

Description

This change updates zero_copy_kernel sample on how the buffer locations are being selected in the sample to match the new 2024.0 IPA interfaces definitions.
In zero_copy_kernel both accessor (requiring device allcoated memory) and USM host pointer are used. In full-system flow, the board spec has defined a device global memory and a host/shared global memory. While in IP-Authoring flow, buffer_location should be specified on accessor and annotated_arg so the compiler can infer global memory interfaces and generate board spec.

Type of change

Please delete options that are not relevant. Add a 'X' to the one that is applicable.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Implement fixes for ONSAM Jiras

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Command Line
  • oneapi-cli
  • Visual Studio
  • Eclipse IDE
  • VSCode
  • When compiling the compliler flag "-Wall -Wformat-security -Werror=format-security" was used

Type* in_zero_copy = malloc_host<Type>(size, q.get_context());
Type* out_zero_copy = malloc_host<Type>(size, q.get_context());
#else
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a comment here similar to the one in this commit: https://github.com/oneapi-src/oneAPI-samples/pull/1890/files#diff-5bf4c46164e0fe924b5cd1ed04885a6c86ebe3710e8f3a89bead31e3e9cf3c78 that motivates why buffer location must be specified for IPA flow.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And add the same to buffer_kernel.hpp in the !IS_BSP clause.

Comment on lines 89 to 91
// The USM pointers passed into the kernel must match with the buffer location
// of each kernel argument, i.e. the allocated host memory should be in
// the location "0", as requested in ZeroCopyKernel
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// The USM pointers passed into the kernel must match with the buffer location
// of each kernel argument, i.e. the allocated host memory should be in
// the location "0", as requested in ZeroCopyKernel
// The USM pointers passed into the kernel must be allocated with the same
// buffer_location as the one specified on the kernel argument with the
// annotated_arg class.

@wangdi4 wangdi4 requested a review from tiwaria1 September 21, 2023 20:38
@wangdi4 wangdi4 changed the title [FPGA] Update zero_copy_kernel sample [FPGA] Update zero_copy_kernel sample to support IP-Authoring Sep 22, 2023
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.

3 participants