-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: omar.ahmed@codeplay.com
- Loading branch information
Showing
12 changed files
with
855 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (C) 2023 Intel Corporation | ||
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. | ||
# See LICENSE.TXT | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
function(add_fuzz_test name label) | ||
set(TEST_TARGET_NAME fuzztest-${name}) | ||
add_ur_executable(${TEST_TARGET_NAME} | ||
urFuzz.cpp) | ||
target_link_libraries(${TEST_TARGET_NAME} | ||
PRIVATE | ||
${PROJECT_NAME}::loader | ||
${PROJECT_NAME}::headers | ||
${PROJECT_NAME}::common | ||
-fsanitize=fuzzer) | ||
add_test(NAME ${TEST_TARGET_NAME} | ||
COMMAND ${TEST_TARGET_NAME} ${ARGN} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) | ||
set_tests_properties(${TEST_TARGET_NAME} PROPERTIES | ||
LABELS ${label} | ||
ENVIRONMENT | ||
"UR_ENABLE_LAYERS=UR_LAYER_FULL_VALIDATION" | ||
"UR_ADAPTERS_FORCE_LOAD=\"$<TARGET_FILE:ur_adapter_null>\"") | ||
target_compile_options(${TEST_TARGET_NAME} PRIVATE -g -fsanitize=fuzzer) | ||
target_compile_definitions(${TEST_TARGET_NAME} PRIVATE -DKERNEL_IL_PATH="${UR_CONFORMANCE_DEVICE_BINARIES_DIR}/bar/sycl_spir641.spv") | ||
target_include_directories(${TEST_TARGET_NAME} PRIVATE ${UR_CONFORMANCE_DEVICE_BINARIES_DIR}) | ||
|
||
add_dependencies(${TEST_TARGET_NAME} generate_device_binaries) | ||
endfunction() | ||
|
||
add_fuzz_test(base fuzz-long | ||
-max_total_time=1 -seed=1 -verbosity=1) | ||
|
||
set(CORPUS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/corpus) | ||
add_fuzz_test(alloc fuzz | ||
${CORPUS_DIR}/alloc -verbosity=1) | ||
|
||
add_fuzz_test(create-release fuzz | ||
${CORPUS_DIR}/create-release -verbosity=1) | ||
|
||
add_fuzz_test(kernel-launch fuzz | ||
${CORPUS_DIR}/kernel-launch -verbosity=1) | ||
|
||
add_fuzz_test(pool-alloc fuzz | ||
${CORPUS_DIR}/pool-alloc -verbosity=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Corpra for fuzz tests with fixed API calls scenarios | ||
These corpra contain UR API calls in a predefined order described below. | ||
All scenarios begin with single calls to urInit() and urAdapterGet(). | ||
|
||
## create-release | ||
Test device/context/pool create and release | ||
|
||
urPlatformGet() | ||
urPlatformGet() | ||
urDeviceGet() | ||
urDeviceGet() | ||
urDeviceRelease() | ||
urDeviceGet() | ||
urDeviceGet() | ||
urContextCreate() | ||
urContextRelease() | ||
urContextCreate() | ||
urUSMPoolCreate() | ||
urUSMPoolCreate() | ||
urUSMPoolRelease() | ||
urUSMPoolRelease() | ||
urUSMPoolCreate() | ||
urUSMPoolCreate() | ||
urUSMPoolCreate() | ||
urUSMPoolCreate() | ||
urUSMPoolRelease() | ||
urUSMPoolRelease() | ||
urUSMPoolRelease() | ||
urUSMPoolRelease() | ||
urContextRelease() | ||
|
||
## pool-alloc | ||
Allocate with host and device pools | ||
|
||
urPlatformGet() | ||
urPlatformGet() | ||
urDeviceGet() | ||
urDeviceGet() | ||
urContextCreate() | ||
urUSMPoolCreate() | ||
urUSMPoolCreate() | ||
urUSMPoolCreate() | ||
urUSMPoolCreate() | ||
urUSMHostAlloc() | ||
urUSMDeviceAlloc() | ||
urUSMFree() | ||
urUSMPoolRelease() | ||
urUSMPoolRelease() | ||
urUSMFree() | ||
urUSMPoolRelease() | ||
urUSMPoolRelease() | ||
urContextRelease() | ||
|
||
## alloc | ||
Allocate on host/device, no pools | ||
|
||
urPlatformGet() | ||
urPlatformGet() | ||
urDeviceGet() | ||
urDeviceGet() | ||
urContextCreate() | ||
urUSMHostAlloc() | ||
urUSMDeviceAlloc() | ||
urUSMFree() | ||
urUSMFree() | ||
urContextRelease() | ||
|
||
## kernel-launch | ||
Launch kernel | ||
|
||
urPlatformGet() | ||
urPlatformGet() | ||
urDeviceGet() | ||
urDeviceGet() | ||
urContextCreate() | ||
urProgramCreateWithIL() | ||
urProgramBuild() | ||
urKernelCreate() | ||
urQueueCreate() | ||
urEnqueueKernelLaunch() | ||
urEventWait() | ||
urEventRelease() | ||
urQueueFinish() | ||
urQueueRelease() | ||
urKernelRelease() | ||
urProgramRelease() | ||
urContextRelease() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.