Skip to content
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

[SYCL] Add new aspect ext_oneapi_virtual_functions #15577

Merged

Conversation

KornevNikita
Copy link
Contributor

Spec: #10540

Copy link
Contributor

@uditagarwal97 uditagarwal97 left a comment

Choose a reason for hiding this comment

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

LGTM!

sycl/source/feature_test.hpp.in Outdated Show resolved Hide resolved
backend BE = getBackend();
bool isCompatibleBE = BE == sycl::backend::ext_oneapi_level_zero ||
BE == sycl::backend::opencl;
return (is_cpu() || is_gpu()) && isCompatibleBE;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this something we'd want to move to UR eventually?

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the criteria of moving things to UR?

The only HW which we don't expect to support function pointers is FPGA. For now we also exclude CUDA & HIP, because we haven't tested those configurations. However, I can imagine that 3rd-party backends may not support necessary SPIR-V extensions we use for virtual functions and therefore the ultimate query should be about SPIR-V extension support here.

Copy link
Contributor

Choose a reason for hiding this comment

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

My rule of thumb is: If you have to check for the backend, it should have been done in UR. On a more general note though, my concern is another implementation of L0 or OpenCL could come in and it wouldn't support these, then this would be invalid. In a case like that, it would have to be addressed in the UR adapters anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

My rule of thumb is: If you have to check for the backend, it should have been done in UR.

Good point. Even though I consider exclusion of CUDA & HIP backends temporary, I don't know if there are any other queries that should be performed for those backends (like checking CUDA SM version or something).

Do we have some generic API which we can extend (device info, I assume), i.e. what is the path of extending UR to support such query?

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be a query like for aspect::ext_oneapi_virtual_mem a couple of lines above. I don't remember if UR has some tooling to help generate more of these enums. @kbenzie is there?

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be a query like for aspect::ext_oneapi_virtual_mem a couple of lines above.

Thanks. Long-term, I think that we should probably move this into UR, but I'm not entirely sure on the name yet. We may add support for generic function pointers later and I believe that aspect for them will be checking for the very same things as we check for virtual functions. Simply because virtual functions are function pointers under the hood.

Therefore, it probably makes sense to have a single generic UR query for both (something like "indirect calls"). However, since we are not yet there with function pointers, I'm hesitant to suggest such generic name just yet.

If there are no objections, I would suggest to have this aspect handled at SYCL level for now and leave a TODO comment to move it into UR later.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be a query like for aspect::ext_oneapi_virtual_mem a couple of lines above. I don't remember if UR has some tooling to help generate more of these enums. @kbenzie is there?

This would entail adding an entry to the ur_device_info_t enum here and runnign the generate target to produce the header and validation layer source changes from that. Then it would be a case of implementing the query in each adapter.

If there are no objections, I would suggest to have this aspect handled at SYCL level for now and leave a TODO comment to move it into UR later.

👍

@KornevNikita
Copy link
Contributor Author

Pre-commit passed, @steffenlarsen @AlexeySachkov could you please merge?

@AlexeySachkov AlexeySachkov merged commit d7e9fd2 into intel:sycl Oct 10, 2024
12 checks passed
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.

5 participants