Specify cl_cache_dir env var: (#2581)

1. General behaviour doesn't work for some compute-runtime versions.
Specification of `cl_cache_dir` fixes it
This commit is contained in:
Vitaliy Urusovskij 2020-10-08 15:02:31 +03:00 committed by GitHub
parent 474dcc277f
commit a4fe59ba0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@ This plugin adds the following command-line options:
""" """
# pylint:disable=import-error # pylint:disable=import-error
import os
import sys import sys
import pytest import pytest
from pathlib import Path from pathlib import Path
@ -115,6 +116,9 @@ def cl_cache_dir(pytestconfig):
More: https://github.com/intel/compute-runtime/blob/master/opencl/doc/FAQ.md#how-can-cl_cache-be-enabled More: https://github.com/intel/compute-runtime/blob/master/opencl/doc/FAQ.md#how-can-cl_cache-be-enabled
""" """
cl_cache_dir = pytestconfig.invocation_dir / "cl_cache" cl_cache_dir = pytestconfig.invocation_dir / "cl_cache"
# if cl_cache generation to a local `cl_cache` folder doesn't work, specify
# `cl_cache_dir` environment variable in an attempt to fix it (Linux specific)
os.environ["cl_cache_dir"] = str(cl_cache_dir)
if cl_cache_dir.exists(): if cl_cache_dir.exists():
shutil.rmtree(cl_cache_dir) shutil.rmtree(cl_cache_dir)
cl_cache_dir.mkdir() cl_cache_dir.mkdir()