diff --git a/sycl/plugins/level_zero/pi_level_zero.cpp b/sycl/plugins/level_zero/pi_level_zero.cpp index 8c486c13d5e21..85ef495550cc1 100644 --- a/sycl/plugins/level_zero/pi_level_zero.cpp +++ b/sycl/plugins/level_zero/pi_level_zero.cpp @@ -1043,7 +1043,7 @@ _pi_queue::resetCommandList(pi_command_list_ptr_t CommandList, } // Configuration of the command-list batching. -typedef struct CommandListBatchConfig { +struct zeCommandListBatchConfig { // Default value of 0. This specifies to use dynamic batch size adjustment. // Other values will try to collect specified amount of commands. pi_uint32 Size{0}; @@ -1066,7 +1066,7 @@ typedef struct CommandListBatchConfig { pi_uint32 startSize() const { return Size > 0 ? Size : DynamicSizeStart; } // Tells is we are doing dynamic batch size adjustment. bool dynamic() const { return Size == 0; } -} zeCommandListBatchConfig; +}; // Helper function to initialize static variables that holds batch config info // for compute and copy command batching. diff --git a/sycl/plugins/level_zero/pi_level_zero.hpp b/sycl/plugins/level_zero/pi_level_zero.hpp index c64c418011312..98764f5e2a38c 100644 --- a/sycl/plugins/level_zero/pi_level_zero.hpp +++ b/sycl/plugins/level_zero/pi_level_zero.hpp @@ -254,7 +254,7 @@ template struct ZeCache : private T { // it is going to initialize, since it is private here in // order to disallow access other than through "->". // - typedef std::function InitFunctionType; + using InitFunctionType = std::function; InitFunctionType Compute{nullptr}; bool Computed{false}; pi_mutex ZeCacheMutex; @@ -492,12 +492,12 @@ struct _pi_device : _pi_object { // The helper structure that keeps info about a command queue groups of the // device. It is not changed after it is initialized. struct queue_group_info_t { - typedef enum { + enum type { MainCopy, LinkCopy, Compute, Size // must be last - } type; + }; // Keep the ordinal of the commands group as returned by // zeDeviceGetCommandQueueGroupProperties. A value of "-1" means that @@ -614,10 +614,10 @@ struct pi_command_list_info_t { }; // The map type that would track all command-lists in a queue. -typedef std::unordered_map - pi_command_list_map_t; +using pi_command_list_map_t = + std::unordered_map; // The iterator pointing to a specific command-list in use. -typedef pi_command_list_map_t::iterator pi_command_list_ptr_t; +using pi_command_list_ptr_t = pi_command_list_map_t::iterator; struct _pi_context : _pi_object { _pi_context(ze_context_handle_t ZeContext, pi_uint32 NumDevices, @@ -936,7 +936,7 @@ struct _pi_queue : _pi_object { pi_command_list_map_t CommandListMap; // Helper data structure to hold all variables related to batching - typedef struct CommandBatch { + struct command_batch { // These two members are used to keep track of how often the // batching closes and executes a command list before reaching the // QueueComputeBatchSize limit, versus how often we reach the limit. @@ -954,7 +954,7 @@ struct _pi_queue : _pi_object { // a queue specific basis. And by putting it in the queue itself, this // is thread safe because of the locking of the queue that occurs. pi_uint32 QueueBatchSize = {0}; - } command_batch; + }; // ComputeCommandBatch holds data related to batching of non-copy commands. // CopyCommandBatch holds data related to batching of copy commands.