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

[SYCL] Adds variant of cache_env_vars for native binaries #1046

Open
wants to merge 2 commits into
base: intel
Choose a base branch
from
Open
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
43 changes: 43 additions & 0 deletions SYCL/KernelAndProgram/cache_env_vars_dg1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// No JITing for host devices.
// REQUIRES: (opencl || level_zero) && gpu-intel-dg1
//
// Default format test cases.
// RUN: rm -rf %t/cache_dir
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out -DTARGET_IMAGE=INC100
// Build program and add item to cache
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
// Ignore caching because image size is less than threshold
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE=100000 %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
// Ignore caching because image size is more than threshold
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE=1000 %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
// Use cache
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 %t.out | FileCheck %s --check-prefixes=CHECK-CACHE
// Ignore cache because of environment variable
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=0 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
//
// ZEBIN format test cases.
// RUN: rm -rf %t/cache_dir
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "--format zebin -device dg1" %s -o %t.out -DTARGET_IMAGE=INC100
// Build program and add item to cache
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
// Ignore caching because image size is less than threshold
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE=100000 %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
// Ignore caching because image size is more than threshold
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE=1000 %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
// Use cache
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 %t.out | FileCheck %s --check-prefixes=CHECK-CACHE
// Ignore cache because of environment variable
// RUN: %BE_RUN_PLACEHOLDER SYCL_CACHE_PERSISTENT=0 SYCL_CACHE_DIR=%t/cache_dir SYCL_PI_TRACE=-1 %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
//
// The test checks environment variables which may disable caching for native
// binaries on DG1.

// CHECK-BUILD-NOT: piProgramCreateWithBinary(
// CHECK-BUILD: piProgramCreate(
// CHECK-BUILD: piProgramBuild(

// CHECK-CACHE-NOT: piProgramCreate(
// CHECK-CACHE: piProgramCreateWithBinary(
// CHECK-CACHE: piProgramBuild(

#include "cache_env_vars.hpp"