-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1482 from oneapi-src/martin/alignedUSMAllocationsCTS
[CTS] Add new urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations test
- Loading branch information
Showing
8 changed files
with
383 additions
and
23 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (C) 2024 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 | ||
|
||
#ifndef UUR_USM_HELPERS_H_INCLUDED | ||
#define UUR_USM_HELPERS_H_INCLUDED | ||
|
||
#include <uur/fixtures.h> | ||
|
||
namespace uur { | ||
|
||
using USMDeviceAllocParams = std::tuple<uur::BoolTestParam, uint32_t, size_t>; | ||
|
||
template <typename T> | ||
inline std::string printUSMAllocTestString( | ||
const testing::TestParamInfo<typename T::ParamType> &info) { | ||
// ParamType will be std::tuple<ur_device_handle_t, USMDeviceAllocParams> | ||
const auto device_handle = std::get<0>(info.param); | ||
const auto platform_device_name = | ||
uur::GetPlatformAndDeviceName(device_handle); | ||
const auto usmDeviceAllocParams = std::get<1>(info.param); | ||
const auto BoolParam = std::get<0>(usmDeviceAllocParams); | ||
|
||
std::stringstream ss; | ||
ss << BoolParam.name << (BoolParam.value ? "Enabled" : "Disabled"); | ||
|
||
const auto alignment = std::get<1>(usmDeviceAllocParams); | ||
const auto size = std::get<2>(usmDeviceAllocParams); | ||
if (alignment && size > 0) { | ||
ss << "_"; | ||
ss << std::get<1>(usmDeviceAllocParams); | ||
ss << "_"; | ||
ss << std::get<2>(usmDeviceAllocParams); | ||
} | ||
|
||
return platform_device_name + "__" + ss.str(); | ||
} | ||
|
||
} // namespace uur | ||
|
||
#endif // UUR_ENQUEUE_RECT_HELPERS_H_INCLUDED |
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
Oops, something went wrong.