Skip to content

Commit

Permalink
Remove not needed structs and reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Xewar313 committed Jan 21, 2025
1 parent 06e7807 commit 9f53547
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
10 changes: 1 addition & 9 deletions source/adapters/level_zero/v2/command_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,17 @@
#include "queue_api.hpp"
#include <ze_api.h>

struct command_buffer_profiling_t {
ur_exp_command_buffer_sync_point_t numEvents;
ze_kernel_timestamp_result_t *timestamps;
};

struct ur_exp_command_buffer_handle_t_ : public _ur_object {
ur_exp_command_buffer_handle_t_(
ur_context_handle_t context, ur_device_handle_t device,
v2::raii::command_list_unique_handle &&commandList,
const ur_exp_command_buffer_desc_t *desc);
~ur_exp_command_buffer_handle_t_() = default;
ur_event_handle_t getSignalEvent(ur_event_handle_t *hUserEvent,
ur_command_t commandType);

ur_command_list_manager commandListManager;

ur_result_t closeCommandList();

std::vector<ze_event_handle_t> waitList;

// Indicates if command-buffer commands can be updated after it is closed.
bool isUpdatable = false;
// Indicates if command buffer was finalized.
Expand All @@ -50,6 +41,7 @@ struct ur_exp_command_buffer_command_handle_t_ : public _ur_object {

~ur_exp_command_buffer_command_handle_t_();

private:
// Command-buffer of this command.
ur_exp_command_buffer_handle_t commandBuffer;
// L0 command ID identifying this command
Expand Down
29 changes: 10 additions & 19 deletions source/adapters/level_zero/v2/queue_immediate_in_order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,8 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueEventsWait(
(commandListManager.getZeCommandList(), numWaitEvents, pWaitEvents));
}

ZE2UR_CALL(
zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));
ZE2UR_CALL(zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));
return UR_RESULT_SUCCESS;
}

Expand Down Expand Up @@ -596,10 +595,8 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueMemBufferMap(
ZE2UR_CALL(zeCommandListAppendWaitOnEvents,
(commandListManager.getZeCommandList(), waitList.second,
waitList.first));
ZE2UR_CALL(
zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));

ZE2UR_CALL(zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));
}

if (blockingMap) {
Expand Down Expand Up @@ -636,10 +633,8 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueMemUnmap(
memoryMigrated = true;
});

ZE2UR_CALL(
zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));

ZE2UR_CALL(zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));

return UR_RESULT_SUCCESS;
}
Expand Down Expand Up @@ -747,10 +742,8 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueUSMPrefetch(
ZE2UR_CALL(zeCommandListAppendMemoryPrefetch,
(commandListManager.getZeCommandList(), pMem, size));

ZE2UR_CALL(
zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));

ZE2UR_CALL(zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));

return UR_RESULT_SUCCESS;
}
Expand Down Expand Up @@ -782,9 +775,8 @@ ur_queue_immediate_in_order_t::enqueueUSMAdvise(const void *pMem, size_t size,
(commandListManager.getZeCommandList(), this->hDevice->ZeDevice,
pMem, size, zeAdvice));

ZE2UR_CALL(
zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));
ZE2UR_CALL(zeCommandListAppendSignalEvent,
(commandListManager.getZeCommandList(), zeSignalEvent));

return UR_RESULT_SUCCESS;
}
Expand Down Expand Up @@ -1027,7 +1019,6 @@ ur_result_t ur_queue_immediate_in_order_t::enqueueTimestampRecordingExp(

std::scoped_lock<ur_shared_mutex> lock(this->Mutex);


if (!phEvent && !*phEvent) {
return UR_RESULT_ERROR_INVALID_NULL_HANDLE;
}
Expand Down

0 comments on commit 9f53547

Please sign in to comment.