Skip to content

Commit 7594c9c

Browse files
committed
common: promote sparse functionality
1 parent 281d20d commit 7594c9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+11
-584
lines changed

cmake/dnnl_compat.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ endmacro()
3434

3535
set(COMPAT_CACHE_BOOL_VARS
3636
"EXPERIMENTAL"
37-
"EXPERIMENTAL_SPARSE"
3837
"EXPERIMENTAL_UKERNEL"
3938
"VERBOSE"
4039
"ENABLE_CONCURRENT_EXEC"

cmake/options.cmake

-5
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,6 @@ option(DNNL_EXPERIMENTAL
204204
using environment variables."
205205
OFF) # disabled by default
206206

207-
option(DNNL_EXPERIMENTAL_SPARSE
208-
"Enable experimental functionality for sparse domain. This option works
209-
independently from DNNL_EXPERIMENTAL."
210-
OFF) # disabled by default
211-
212207
option(DNNL_EXPERIMENTAL_UKERNEL
213208
"Enable experimental functionality for ukernels. This option works
214209
independently from DNNL_EXPERIMENTAL."

doc/Doxyfile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ INCLUDE_FILE_PATTERNS =
19621962
# recursively expanded use the := operator instead of the = operator.
19631963
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
19641964

1965-
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS DNNL_GPU_RUNTIME=DNNL_RUNTIME_OCL DNNL_WITH_SYCL DNNL_USE_SYCL_BUFFERS DNNL_EXPERIMENTAL_SPARSE DNNL_EXPERIMENTAL_UKERNEL DNNL_EXPERIMENTAL_LOGGING
1965+
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS DNNL_GPU_RUNTIME=DNNL_RUNTIME_OCL DNNL_WITH_SYCL DNNL_USE_SYCL_BUFFERS DNNL_EXPERIMENTAL_UKERNEL DNNL_EXPERIMENTAL_LOGGING
19661966

19671967
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
19681968
# tag can be used to specify a list of macro names that should be expanded. The

doc/advanced/experimental.md

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Both kinds of experimental features can be enabled simultaneously.
2727

2828
| Build time option | Description |
2929
|:-------------------------------------------|:-------------------------------------------------------------------|
30-
| ONEDNN_EXPERIMENTAL_SPARSE | Enable experimental API and functionality for sparse domain. |
3130
| ONEDNN_EXPERIMENTAL_UKERNEL | Enable experimental microkernel APIs and functionalities. |
3231
| ONEDNN_EXPERIMENTAL_PROFILING | Enable experimental profiling API. |
3332
| ONEDNN_EXPERIMENTAL_GRAPH_COMPILER_BACKEND | Enable experimental graph compiler backend of the graph component. |

examples/CMakeLists.txt

-6
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ append_host_compiler_options(CMAKE_CXX_FLAGS "${DPCPP_CXX_NOWARN_FLAGS}")
5555
file(GLOB_RECURSE sources *.cpp *.c)
5656
file(GLOB_RECURSE headers *.hpp *.h)
5757

58-
if(NOT DNNL_EXPERIMENTAL_SPARSE)
59-
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/cpu_matmul_csr.cpp)
60-
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/cpu_matmul_coo.cpp)
61-
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/cpu_matmul_weights_compression.cpp)
62-
endif()
63-
6458
if(NOT DNNL_EXPERIMENTAL_UKERNEL)
6559
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/ukernels/cpu_brgemm.cpp)
6660
endif()

include/oneapi/dnnl/dnnl.h

-14
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,6 @@ dnnl_status_t DNNL_API dnnl_memory_desc_create_with_tag(
881881
dnnl_memory_desc_t *memory_desc, int ndims, const dnnl_dims_t dims,
882882
dnnl_data_type_t data_type, dnnl_format_tag_t tag);
883883

884-
#ifdef DNNL_EXPERIMENTAL_SPARSE
885884
/// Creates a memory descriptor for CSR encoding.
886885
///
887886
/// @param memory_desc Output memory descriptor.
@@ -943,7 +942,6 @@ dnnl_status_t DNNL_API dnnl_memory_desc_create_with_coo_encoding(
943942
dnnl_status_t DNNL_API dnnl_memory_desc_create_with_packed_encoding(
944943
dnnl_memory_desc_t *memory_desc, int ndims, const dnnl_dims_t dims,
945944
dnnl_data_type_t data_type, dnnl_dim_t nnz);
946-
#endif
947945

948946
/// Creates a memory descriptor for a region inside an area
949947
/// described by an existing memory descriptor.
@@ -1109,7 +1107,6 @@ dnnl_status_t DNNL_API dnnl_memory_desc_permute_axes(
11091107
dnnl_status_t DNNL_API dnnl_memory_desc_query(
11101108
const_dnnl_memory_desc_t memory_desc, dnnl_query_t what, void *result);
11111109

1112-
#ifdef DNNL_EXPERIMENTAL_SPARSE
11131110
/// Queries a memory descriptor for various pieces of information. This version
11141111
/// support additional queries #dnnl_query_sparse_encoding, #dnnl_query_nnz_s64
11151112
/// #dnnl_query_num_handles_s32 and #dnnl_query_data_type for a particular
@@ -1167,7 +1164,6 @@ dnnl_status_t DNNL_API dnnl_memory_desc_query(
11671164
dnnl_status_t DNNL_API dnnl_memory_desc_query_v2(
11681165
const_dnnl_memory_desc_t memory_desc, dnnl_query_t what, int index,
11691166
void *result);
1170-
#endif
11711167

11721168
/// Compares two memory descriptors.
11731169
///
@@ -1188,7 +1184,6 @@ int DNNL_API dnnl_memory_desc_equal(
11881184
/// descriptor.
11891185
size_t DNNL_API dnnl_memory_desc_get_size(const_dnnl_memory_desc_t memory_desc);
11901186

1191-
#ifdef DNNL_EXPERIMENTAL_SPARSE
11921187
/// Returns the size of the data that corresponds to the given index.
11931188
///
11941189
/// @param memory_desc Memory descriptor.
@@ -1197,7 +1192,6 @@ size_t DNNL_API dnnl_memory_desc_get_size(const_dnnl_memory_desc_t memory_desc);
11971192
/// @returns The number of bytes required for the requested data.
11981193
size_t DNNL_API dnnl_memory_desc_get_size_v2(
11991194
const_dnnl_memory_desc_t memory_desc, int index);
1200-
#endif
12011195

12021196
/// Returns the size of data type.
12031197
///
@@ -1229,7 +1223,6 @@ dnnl_status_t DNNL_API dnnl_memory_create(dnnl_memory_t *memory,
12291223
const_dnnl_memory_desc_t memory_desc, dnnl_engine_t engine,
12301224
void *handle);
12311225

1232-
#ifdef DNNL_EXPERIMENTAL_SPARSE
12331226
/// Creates a memory object with multiple handles.
12341227
///
12351228
/// @param memory Output memory object.
@@ -1250,7 +1243,6 @@ dnnl_status_t DNNL_API dnnl_memory_create(dnnl_memory_t *memory,
12501243
dnnl_status_t DNNL_API dnnl_memory_create_v2(dnnl_memory_t *memory,
12511244
const_dnnl_memory_desc_t memory_desc, dnnl_engine_t engine,
12521245
int nhandles, void **handles);
1253-
#endif
12541246

12551247
/// Returns the memory descriptor for a memory object.
12561248
///
@@ -1296,7 +1288,6 @@ dnnl_status_t DNNL_API dnnl_memory_get_engine(
12961288
dnnl_status_t DNNL_API dnnl_memory_map_data(
12971289
const_dnnl_memory_t memory, void **mapped_ptr);
12981290

1299-
#ifdef DNNL_EXPERIMENTAL_SPARSE
13001291
/// Maps a memory object and returns a host-side pointer to a memory buffer
13011292
/// with a copy of its contents. The memory buffer corresponds to the given
13021293
/// index.
@@ -1324,7 +1315,6 @@ dnnl_status_t DNNL_API dnnl_memory_map_data(
13241315
/// otherwise.
13251316
dnnl_status_t DNNL_API dnnl_memory_map_data_v2(
13261317
const_dnnl_memory_t memory, void **mapped_ptr, int index);
1327-
#endif
13281318

13291319
/// Unmaps a memory object and writes back any changes made to the previously
13301320
/// mapped memory buffer. The pointer to the mapped buffer must be obtained
@@ -1343,7 +1333,6 @@ dnnl_status_t DNNL_API dnnl_memory_map_data_v2(
13431333
dnnl_status_t DNNL_API dnnl_memory_unmap_data(
13441334
const_dnnl_memory_t memory, void *mapped_ptr);
13451335

1346-
#ifdef DNNL_EXPERIMENTAL_SPARSE
13471336
/// Unmaps a memory object and writes back any changes made to the previously
13481337
/// mapped memory buffer. The pointer to the mapped buffer must be obtained
13491338
/// via the dnnl_memory_map_data() call. The buffer corresponds to the given
@@ -1362,7 +1351,6 @@ dnnl_status_t DNNL_API dnnl_memory_unmap_data(
13621351
/// otherwise.
13631352
dnnl_status_t DNNL_API dnnl_memory_unmap_data_v2(
13641353
const_dnnl_memory_t memory, void *mapped_ptr, int index);
1365-
#endif
13661354

13671355
/// Returns memory object's data handle.
13681356
///
@@ -1385,7 +1373,6 @@ dnnl_status_t DNNL_API dnnl_memory_get_data_handle(
13851373
dnnl_status_t DNNL_API dnnl_memory_set_data_handle(
13861374
dnnl_memory_t memory, void *handle);
13871375

1388-
#ifdef DNNL_EXPERIMENTAL_SPARSE
13891376
/// Returns an underlying memory buffer that corresponds to the given index.
13901377
///
13911378
/// @param memory Memory object.
@@ -1409,7 +1396,6 @@ dnnl_status_t DNNL_API dnnl_memory_get_data_handle_v2(
14091396
/// otherwise.
14101397
dnnl_status_t DNNL_API dnnl_memory_set_data_handle_v2(
14111398
dnnl_memory_t memory, void *handle, int index);
1412-
#endif
14131399

14141400
/// Destroys a memory object.
14151401
///

0 commit comments

Comments
 (0)