Skip to content

[SYCL] Store version in CGAdviseUSM to enable extended members #4057

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

Merged
merged 1 commit into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions sycl/include/CL/sycl/detail/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,13 @@ class CGAdviseUSM : public CG {

public:
CGAdviseUSM(void *DstPtr, size_t Length,
vector_class<vector_class<char>> ArgsStorage,
vector_class<detail::AccessorImplPtr> AccStorage,
vector_class<shared_ptr_class<const void>> SharedPtrStorage,
vector_class<Requirement *> Requirements,
vector_class<detail::EventImplPtr> Events,
std::vector<std::vector<char>> ArgsStorage,
std::vector<detail::AccessorImplPtr> AccStorage,
std::vector<std::shared_ptr<const void>> SharedPtrStorage,
std::vector<Requirement *> Requirements,
std::vector<detail::EventImplPtr> Events, CGTYPE Type,
detail::code_location loc = {})
: CG(ADVISE_USM, std::move(ArgsStorage), std::move(AccStorage),
: CG(Type, std::move(ArgsStorage), std::move(AccStorage),
std::move(SharedPtrStorage), std::move(Requirements),
std::move(Events), std::move(loc)),
MDst(DstPtr), MLength(Length) {}
Expand Down
10 changes: 5 additions & 5 deletions sycl/source/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ event handler::finalize() {
CommandGroup.reset(new detail::CGAdviseUSM(
MDstPtr, MLength, std::move(MArgsStorage), std::move(MAccStorage),
std::move(MSharedPtrStorage), std::move(MRequirements),
std::move(MEvents), MCodeLoc));
std::move(MEvents), MCGType, MCodeLoc));
break;
case detail::CG::CODEPLAY_HOST_TASK:
CommandGroup.reset(new detail::CGHostTask(
Expand Down Expand Up @@ -488,29 +488,29 @@ void handler::memcpy(void *Dest, const void *Src, size_t Count) {
MSrcPtr = const_cast<void *>(Src);
MDstPtr = Dest;
MLength = Count;
MCGType = detail::CG::COPY_USM;
setType(detail::CG::COPY_USM);
}

void handler::memset(void *Dest, int Value, size_t Count) {
throwIfActionIsCreated();
MDstPtr = Dest;
MPattern.push_back(static_cast<char>(Value));
MLength = Count;
MCGType = detail::CG::FILL_USM;
setType(detail::CG::FILL_USM);
}

void handler::prefetch(const void *Ptr, size_t Count) {
throwIfActionIsCreated();
MDstPtr = const_cast<void *>(Ptr);
MLength = Count;
MCGType = detail::CG::PREFETCH_USM;
setType(detail::CG::PREFETCH_USM);
}

void handler::mem_advise(const void *Ptr, size_t Count, pi_mem_advice Advice) {
throwIfActionIsCreated();
MDstPtr = const_cast<void *>(Ptr);
MLength = Count;
MCGType = detail::CG::ADVISE_USM;
setType(detail::CG::ADVISE_USM);

assert(!MSharedPtrStorage.empty());

Expand Down