Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][L0] Test for pooled small allocations. #980

Merged
merged 4 commits into from
May 6, 2022
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
2 changes: 1 addition & 1 deletion SYCL/Plugin/interop-level-zero-buffer-ownership.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// account direct calls to L0 API.
// UNSUPPORTED: ze_debug-1,ze_debug4
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
// RUN: env SYCL_DEVICE_FILTER=level_zero ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck %s
// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 SYCL_DEVICE_FILTER=level_zero ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck %s

// Test for Level Zero buffer interop API.
// Check the following cases:
Expand Down
15 changes: 15 additions & 0 deletions SYCL/USM/usm_pooling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
// RUN: env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %t.out d 2> %t1.out; cat %t1.out %GPU_CHECK_PLACEHOLDER --check-prefix CHECK-1245
// RUN: env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %t.out s 2> %t1.out; cat %t1.out %GPU_CHECK_PLACEHOLDER --check-prefix CHECK-1245

// With pooling enabled and SlabMinSize of 4 MB: 1,5 allocs lead to ZE call.
// RUN: env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %t.out h 2> %t1.out; cat %t1.out %GPU_CHECK_PLACEHOLDER --check-prefix CHECK-15
// RUN: env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %t.out d 2> %t1.out; cat %t1.out %GPU_CHECK_PLACEHOLDER --check-prefix CHECK-15
// RUN: env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %t.out s 2> %t1.out; cat %t1.out %GPU_CHECK_PLACEHOLDER --check-prefix CHECK-15

#include "CL/sycl.hpp"
using namespace sycl;

Expand Down Expand Up @@ -124,3 +129,13 @@ int main(int argc, char *argv[]) {
// CHECK-1245-NEXT: ZE ---> zeMemFree
// CHECK-1245-NEXT: ZE ---> [[API]](
// CHECK-1245-NEXT: ZE ---> [[API]](

// CHECK-15: Test [[API:zeMemAllocHost|zeMemAllocDevice|zeMemAllocShared]]
// CHECK-15-NEXT: ZE ---> [[API]](
// CHECK-15-NEXT: ZE ---> zeMemGetAllocProperties
// CHECK-15-NEXT: ZE ---> zeMemGetAllocProperties
// CHECK-15-NEXT: ZE ---> [[API]](
// CHECK-15-NEXT: ZE ---> zeMemGetAllocProperties
// CHECK-15-NEXT: ZE ---> zeMemGetAllocProperties
// CHECK-15-NEXT: ZE ---> zeMemGetAllocProperties
// CHECK-15-NEXT: ZE ---> zeMemFree