-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL][Graph] async_malloc use allocation size for zeVirtualMemQueryPageSize #19402
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
Changes from all commits
d51d3a1
6dee5d6
bb9ddc7
442eef3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//==---------------- virtual_mem.hpp ---------------------------------------==// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#pragma once | ||
|
||
#include <sycl/ext/oneapi/virtual_mem/virtual_mem.hpp> | ||
|
||
namespace sycl { | ||
inline namespace _V1 { | ||
namespace ext::oneapi::experimental { | ||
|
||
size_t | ||
get_mem_granularity_for_allocation_size(const detail::device_impl &SyclDevice, | ||
const detail::context_impl &SyclContext, | ||
granularity_mode Mode, | ||
size_t AllocationSize); | ||
|
||
} // namespace ext::oneapi::experimental | ||
} // namespace _V1 | ||
} // namespace sycl |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
// RUN: %if level_zero %{%{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} | ||
|
||
#define GRAPH_E2E_EXPLICIT | ||
|
||
#include "../Inputs/async_alloc_different_sizes.cpp" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Tests async allocations with different sizes. | ||
|
||
#include "../../graph_common.hpp" | ||
#include <sycl/ext/oneapi/experimental/async_alloc/async_alloc.hpp> | ||
|
||
void asyncAllocWorksWithSize(size_t Size) { | ||
queue Queue{}; | ||
|
||
exp_ext::command_graph Graph{Queue.get_context(), Queue.get_device()}; | ||
|
||
void *AsyncPtr = nullptr; | ||
// Add alloc node | ||
auto AllocNode = add_node(Graph, Queue, [&](handler &CGH) { | ||
AsyncPtr = exp_ext::async_malloc(CGH, usm::alloc::device, Size); | ||
}); | ||
|
||
add_node( | ||
Graph, Queue, | ||
[&](handler &CGH) { | ||
depends_on_helper(CGH, AllocNode); | ||
exp_ext::async_free(CGH, AsyncPtr); | ||
}, | ||
AllocNode); | ||
|
||
auto GraphExec = Graph.finalize(); | ||
} | ||
|
||
int main() { | ||
asyncAllocWorksWithSize(1); | ||
asyncAllocWorksWithSize(131); | ||
asyncAllocWorksWithSize(10071); | ||
asyncAllocWorksWithSize(1007177); | ||
asyncAllocWorksWithSize(191439360); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
// RUN: %if level_zero %{%{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} | ||
|
||
#define GRAPH_E2E_RECORD_REPLAY | ||
|
||
#include "../Inputs/async_alloc_different_sizes.cpp" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.