Skip to content

Commit

Permalink
Fix mistakes in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiomestre committed Sep 4, 2024
1 parent 5122527 commit bf49ae5
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 760 deletions.
2 changes: 1 addition & 1 deletion include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -8393,7 +8393,7 @@ urCommandBufferFinalizeExp(
/// - ::UR_RESULT_ERROR_INVALID_VALUE
/// + `phKernelAlternatives == NULL && numKernelAlternatives > 0`
/// + `phKernelAlternatives != NULL && numKernelAlternatives == 0`
/// + `phKernelAlternatives` contains `hKernel`
/// + If `phKernelAlternatives` contains `hKernel`
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP
/// + `pSyncPointWaitList == NULL && numSyncPointsInWaitList > 0`
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/exp-command-buffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ returns:
- $X_RESULT_ERROR_INVALID_VALUE:
- "`phKernelAlternatives == NULL && numKernelAlternatives > 0`"
- "`phKernelAlternatives != NULL && numKernelAlternatives == 0`"
- "`phKernelAlternatives` contains `hKernel`"
- "If `phKernelAlternatives` contains `hKernel`"
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP:
- "`pSyncPointWaitList == NULL && numSyncPointsInWaitList > 0`"
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
return UR_RESULT_ERROR_INVALID_OPERATION;
}

if (auto NewWorkDim = pUpdateKernelLaunch->newWorkDim) {
if (pUpdateKernelLaunch->newWorkDim) {

// Error If Local size and not global size
if ((pUpdateKernelLaunch->pNewLocalWorkSize != nullptr) &&
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/level_zero/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ ur_result_t ur_context_handle_t_::getAvailableCommandList(

ze_result_t ZeResult =
ZE_CALL_NOCHECK(zeFenceQueryStatus, (it->second.ZeFence));
if (ZeResult == ZE_RESULT_SUCCESS) {
if (ZeResult _ == ZE_RESULT_SUCCESS) {
std::vector<ur_event_handle_t> EventListToCleanup;
Queue->resetCommandList(it, false, EventListToCleanup);
CleanupEventListFromResetCmdList(EventListToCleanup,
Expand Down
1 change: 1 addition & 0 deletions source/adapters/level_zero/v2/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
ur_exp_command_buffer_handle_t hCommandBuffer, ur_kernel_handle_t hKernel,
uint32_t workDim, const size_t *pGlobalWorkOffset,
const size_t *pGlobalWorkSize, const size_t *pLocalWorkSize,
uint32_t numKernelAlternatives, ur_kernel_handle_t *phKernelAlternatives,
uint32_t numSyncPointsInWaitList,
const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList,
ur_exp_command_buffer_sync_point_t *pSyncPoint,
Expand Down
4 changes: 0 additions & 4 deletions source/loader/layers/validation/ur_valddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8105,10 +8105,6 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
return UR_RESULT_ERROR_INVALID_VALUE;
}

if (phKernelAlternatives` contains `hKernel) {
return UR_RESULT_ERROR_INVALID_VALUE;
}

if (pSyncPointWaitList == NULL && numSyncPointsInWaitList > 0) {
return UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP;
}
Expand Down
2 changes: 1 addition & 1 deletion source/loader/ur_libapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7527,7 +7527,7 @@ ur_result_t UR_APICALL urCommandBufferFinalizeExp(
/// - ::UR_RESULT_ERROR_INVALID_VALUE
/// + `phKernelAlternatives == NULL && numKernelAlternatives > 0`
/// + `phKernelAlternatives != NULL && numKernelAlternatives == 0`
/// + `phKernelAlternatives` contains `hKernel`
/// + If `phKernelAlternatives` contains `hKernel`
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP
/// + `pSyncPointWaitList == NULL && numSyncPointsInWaitList > 0`
Expand Down
2 changes: 1 addition & 1 deletion source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6383,7 +6383,7 @@ ur_result_t UR_APICALL urCommandBufferFinalizeExp(
/// - ::UR_RESULT_ERROR_INVALID_VALUE
/// + `phKernelAlternatives == NULL && numKernelAlternatives > 0`
/// + `phKernelAlternatives != NULL && numKernelAlternatives == 0`
/// + `phKernelAlternatives` contains `hKernel`
/// + If `phKernelAlternatives` contains `hKernel`
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP
/// + `pSyncPointWaitList == NULL && numSyncPointsInWaitList > 0`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
urCommandBufferKernelHandleUpdateTest.Success/AMD_HIP_BACKEND___{{.*}}_
urCommandBufferKernelHandleUpdateTest.UpdateAgain/AMD_HIP_BACKEND___{{.*}}_
urCommandBufferKernelHandleUpdateTest.KernelAlternativeNotRegistered/AMD_HIP_BACKEND___{{.*}}_
urCommandBufferKernelHandleUpdateTest.RegisterInvalidKernelAlternative/AMD_HIP_BACKEND___{{.*}}_
Original file line number Diff line number Diff line change
@@ -1,34 +1,7 @@
BufferFillCommandTest.UpdateParameters/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
BufferFillCommandTest.UpdateGlobalSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
BufferFillCommandTest.SeparateUpdateCalls/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
BufferFillCommandTest.OverrideUpdate/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
BufferFillCommandTest.OverrideArgList/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
USMFillCommandTest.UpdateParameters/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
USMFillCommandTest.UpdateBeforeEnqueue/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
USMMultipleFillCommandTest.UpdateAllKernels/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
BufferSaxpyKernelTest.UpdateParameters/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
USMSaxpyKernelTest.UpdateParameters/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
USMMultiSaxpyKernelTest.UpdateParameters/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
USMMultiSaxpyKernelTest.UpdateWithoutBlocking/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
NDRangeUpdateTest.Update3D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
NDRangeUpdateTest.Update2D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
NDRangeUpdateTest.Update1D/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
NDRangeUpdateTest.Invalid/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferReleaseExpTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferReleaseExpTest.InvalidNullHandle/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferReleaseCommandExpTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferReleaseCommandExpTest.ReleaseCmdBufBeforeHandle/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferReleaseCommandExpTest.ReleaseCmdBufMultipleHandles/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferReleaseCommandExpTest.InvalidNullHandle/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferRetainExpTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferRetainExpTest.InvalidNullHandle/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferRetainCommandExpTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferRetainCommandExpTest.InvalidNullHandle/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
InvalidUpdateTest.NotFinalizedCommandBuffer/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
InvalidUpdateTest.NotUpdatableCommandBuffer/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
InvalidUpdateTest.GlobalLocalSizeMistach/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
InvalidUpdateTest.ImplToUserDefinedLocalSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
InvalidUpdateTest.UserToImplDefinedLocalSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferCommandsTest.urCommandBufferAppendUSMMemcpyExp/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferCommandsTest.urCommandBufferAppendUSMFillExp/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferCommandsTest.urCommandBufferAppendMemBufferCopyExp/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
Expand All @@ -55,8 +28,3 @@ urCommandBufferFillCommandsTest.USM/Intel_R__oneAPI_Unified_Runtime_over_Level_Z
urCommandBufferFillCommandsTest.USM/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___size__256__patternSize__8
urCommandBufferFillCommandsTest.USM/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___size__256__patternSize__16
urCommandBufferFillCommandsTest.USM/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___size__256__patternSize__32
urCommandBufferKernelHandleUpdateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferKernelHandleUpdateTest.UpdateAgain/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferKernelHandleUpdateTest.KernelAlternativeNotRegistered/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urCommandBufferKernelHandleUpdateTest.RegisterInvalidKernelAlternative/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#include "uur/raii.h"
#include <cstring>

// Tests that it is possible to update the kernel handle of a command-buffer node.
// This test launches a Saxpy kernel using a command-buffer and then updates the
// node with a completely different kernel that does a fill 2D operation.
struct TestKernel {

TestKernel(std::string Name, ur_platform_handle_t Platform,
Expand Down Expand Up @@ -247,6 +244,9 @@ struct urCommandBufferKernelHandleUpdateTest

UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urCommandBufferKernelHandleUpdateTest);

/* Tests that it is possible to update the kernel handle of a command-buffer node.
* This test launches a Saxpy kernel using a command-buffer and then updates the
* node with a completely different kernel that does a fill 2D operation. */
TEST_P(urCommandBufferKernelHandleUpdateTest, Success) {

std::vector<ur_kernel_handle_t> KernelAlternatives = {
Expand Down
Loading

0 comments on commit bf49ae5

Please sign in to comment.