Skip to content

Commit bb7ece7

Browse files
authored
Minor comment/style tweaks to the null HAL driver. (#18911)
1 parent 7f14078 commit bb7ece7

File tree

21 files changed

+84
-10
lines changed

21 files changed

+84
-10
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
# Experimental
3333
# It's experimental, but we still don't want any old directory added here.
3434
/experimental/ @benvanik @stellaraccident
35-
/experimental/rocm/ @benvanik
3635
/experimental/web/ @ScottTodd
3736
/experimental/webgpu/ @benvanik @ScottTodd
3837

runtime/src/iree/hal/drivers/null/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ fill (memset) you can often implement copy (memcpy) as well at the same time.
1717
`experimental/` folder if going in-tree.
1818
1. Find/replace `{Null}` with the friendly name of your driver (e.g. `Vulkan`).
1919
1. Find/replace `_null_` with the C name of your driver (e.g. `vulkan`).
20+
1. Find/replace `_NULL_` with the upper C name of your driver (e.g. `VULKAN`).
2021
1. Find/replace `// TODO(null):` with your github ID, your driver name, or a
2122
GitHub issue number tracking driver creation (e.g. `// TODO(#1234):`).
23+
1. Find/replace `iree/hal/drivers/null/` with your source path.
2224

2325
## Build Setup
2426

runtime/src/iree/hal/drivers/null/allocator.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
#include "iree/hal/drivers/null/buffer.h"
1010

11+
//===----------------------------------------------------------------------===//
12+
// iree_hal_null_allocator_t
13+
//===----------------------------------------------------------------------===//
14+
1115
// TODO(null): use one ID per address space or pool - each shows as a different
1216
// track in tracing tools.
1317
#if IREE_TRACING_FEATURES & IREE_TRACING_FEATURE_ALLOCATION_TRACKING
@@ -33,6 +37,7 @@ iree_status_t iree_hal_null_allocator_create(
3337
iree_allocator_t host_allocator, iree_hal_allocator_t** out_allocator) {
3438
IREE_ASSERT_ARGUMENT(out_allocator);
3539
IREE_TRACE_ZONE_BEGIN(z0);
40+
*out_allocator = NULL;
3641

3742
iree_hal_null_allocator_t* allocator = NULL;
3843
IREE_RETURN_AND_END_ZONE_IF_ERROR(

runtime/src/iree/hal/drivers/null/allocator.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "iree/base/api.h"
1111
#include "iree/hal/api.h"
1212

13+
//===----------------------------------------------------------------------===//
14+
// iree_hal_null_allocator_t
15+
//===----------------------------------------------------------------------===//
16+
1317
// Creates a {Null} buffer allocator used for persistent allocations.
1418
iree_status_t iree_hal_null_allocator_create(
1519
iree_allocator_t host_allocator, iree_hal_allocator_t** out_allocator);

runtime/src/iree/hal/drivers/null/buffer.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
#include "iree/hal/drivers/null/buffer.h"
88

9+
//===----------------------------------------------------------------------===//
10+
// iree_hal_null_buffer_t
11+
//===----------------------------------------------------------------------===//
12+
913
typedef struct iree_hal_null_buffer_t {
1014
iree_hal_buffer_t base;
1115
iree_hal_buffer_release_callback_t release_callback;
@@ -33,8 +37,8 @@ iree_status_t iree_hal_null_buffer_wrap(
3337
iree_hal_buffer_release_callback_t release_callback,
3438
iree_allocator_t host_allocator, iree_hal_buffer_t** out_buffer) {
3539
IREE_ASSERT_ARGUMENT(out_buffer);
36-
*out_buffer = NULL;
3740
IREE_TRACE_ZONE_BEGIN(z0);
41+
*out_buffer = NULL;
3842

3943
iree_hal_null_buffer_t* buffer = NULL;
4044
IREE_RETURN_AND_END_ZONE_IF_ERROR(

runtime/src/iree/hal/drivers/null/buffer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "iree/base/api.h"
1111
#include "iree/hal/api.h"
1212

13+
//===----------------------------------------------------------------------===//
14+
// iree_hal_null_buffer_t
15+
//===----------------------------------------------------------------------===//
16+
1317
// Wraps a {Null} allocation in an iree_hal_buffer_t.
1418
iree_status_t iree_hal_null_buffer_wrap(
1519
iree_hal_allocator_t* allocator, iree_hal_memory_type_t memory_type,

runtime/src/iree/hal/drivers/null/channel.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
#include "iree/hal/drivers/null/channel.h"
88

9+
//===----------------------------------------------------------------------===//
10+
// iree_hal_null_channel_t
11+
//===----------------------------------------------------------------------===//
12+
913
typedef struct iree_hal_null_channel_t {
1014
iree_hal_resource_t resource;
1115
iree_allocator_t host_allocator;
@@ -34,8 +38,8 @@ iree_status_t iree_hal_null_channel_create(iree_hal_channel_params_t params,
3438
iree_allocator_t host_allocator,
3539
iree_hal_channel_t** out_channel) {
3640
IREE_ASSERT_ARGUMENT(out_channel);
37-
*out_channel = NULL;
3841
IREE_TRACE_ZONE_BEGIN(z0);
42+
*out_channel = NULL;
3943

4044
iree_hal_null_channel_t* channel = NULL;
4145
IREE_RETURN_AND_END_ZONE_IF_ERROR(

runtime/src/iree/hal/drivers/null/channel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "iree/base/api.h"
1111
#include "iree/hal/api.h"
1212

13+
//===----------------------------------------------------------------------===//
14+
// iree_hal_null_channel_t
15+
//===----------------------------------------------------------------------===//
16+
1317
// Creates a {Null} HAL collective channel using the given |params|.
1418
iree_status_t iree_hal_null_channel_create(iree_hal_channel_params_t params,
1519
iree_allocator_t host_allocator,

runtime/src/iree/hal/drivers/null/command_buffer.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "iree/hal/drivers/null/channel.h"
1111
#include "iree/hal/drivers/null/executable.h"
1212

13+
//===----------------------------------------------------------------------===//
14+
// iree_hal_null_command_buffer_t
15+
//===----------------------------------------------------------------------===//
16+
1317
typedef struct iree_hal_null_command_buffer_t {
1418
iree_hal_command_buffer_t base;
1519
iree_allocator_t host_allocator;
@@ -31,8 +35,8 @@ iree_status_t iree_hal_null_command_buffer_create(
3135
iree_allocator_t host_allocator,
3236
iree_hal_command_buffer_t** out_command_buffer) {
3337
IREE_ASSERT_ARGUMENT(out_command_buffer);
34-
*out_command_buffer = NULL;
3538
IREE_TRACE_ZONE_BEGIN(z0);
39+
*out_command_buffer = NULL;
3640

3741
iree_hal_null_command_buffer_t* command_buffer = NULL;
3842
IREE_RETURN_AND_END_ZONE_IF_ERROR(

runtime/src/iree/hal/drivers/null/command_buffer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "iree/base/api.h"
1111
#include "iree/hal/api.h"
1212

13+
//===----------------------------------------------------------------------===//
14+
// iree_hal_null_command_buffer_t
15+
//===----------------------------------------------------------------------===//
16+
1317
// Creates {Null} command buffer.
1418
iree_status_t iree_hal_null_command_buffer_create(
1519
iree_hal_allocator_t* device_allocator, iree_hal_command_buffer_mode_t mode,

0 commit comments

Comments
 (0)