Skip to content

Commit 2ca644c

Browse files
Sourabh Betigeriagunashe
authored andcommitted
Revert "SWDEV-440866 - [hip-roclr] Adds support to batch memory operations APIs"
This reverts commit bd5d8e9. Reason for revert: hipInfo fails on windows. Updating llvm amd-mainline-closed Change-Id: I57e1fa1945188b0bc0a799c4f3d540f2b7713003
1 parent 08aee16 commit 2ca644c

File tree

18 files changed

+16
-217
lines changed

18 files changed

+16
-217
lines changed

hipamd/include/hip/amd_detail/hip_api_trace.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
// - Reset any of the *_STEP_VERSION defines to zero if the corresponding *_MAJOR_VERSION increases
6262
#define HIP_API_TABLE_STEP_VERSION 0
6363
#define HIP_COMPILER_API_TABLE_STEP_VERSION 0
64-
#define HIP_RUNTIME_API_TABLE_STEP_VERSION 7
64+
#define HIP_RUNTIME_API_TABLE_STEP_VERSION 6
6565

6666
// HIP API interface
6767
typedef hipError_t (*t___hipPopCallConfiguration)(dim3* gridDim, dim3* blockDim, size_t* sharedMem,
@@ -722,8 +722,6 @@ typedef hipError_t (*t_hipStreamWriteValue32)(hipStream_t stream, void* ptr, uin
722722
unsigned int flags);
723723
typedef hipError_t (*t_hipStreamWriteValue64)(hipStream_t stream, void* ptr, uint64_t value,
724724
unsigned int flags);
725-
typedef hipError_t (*t_hipStreamBatchMemOp)(hipStream_t stream, unsigned int count,
726-
hipStreamBatchMemOpParams* paramArray, unsigned int flags);
727725
typedef hipError_t (*t_hipTexObjectCreate)(hipTextureObject_t* pTexObject,
728726
const HIP_RESOURCE_DESC* pResDesc,
729727
const HIP_TEXTURE_DESC* pTexDesc,
@@ -1521,9 +1519,6 @@ struct HipDispatchTable {
15211519
// HIP_RUNTIME_API_TABLE_STEP_VERSION == 6
15221520
t_hipDeviceGetTexture1DLinearMaxWidth hipDeviceGetTexture1DLinearMaxWidth_fn;
15231521

1524-
// HIP_RUNTIME_API_TABLE_STEP_VERSION == 7
1525-
t_hipStreamBatchMemOp hipStreamBatchMemOp_fn;
1526-
15271522
// DO NOT EDIT ABOVE!
15281523
// HIP_RUNTIME_API_TABLE_STEP_VERSION == 7
15291524

hipamd/include/hip/amd_detail/hip_prof_str.h

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ enum hip_api_id_t {
425425
HIP_API_ID_hipMemcpyHtoAAsync = 405,
426426
HIP_API_ID_hipSetValidDevices = 406,
427427
HIP_API_ID_hipExtHostAlloc = 407,
428-
HIP_API_ID_hipStreamBatchMemOp = 408,
429-
HIP_API_ID_LAST = 408,
428+
HIP_API_ID_LAST = 407,
430429

431430
HIP_API_ID_hipChooseDevice = HIP_API_ID_CONCAT(HIP_API_ID_,hipChooseDevice),
432431
HIP_API_ID_hipGetDeviceProperties = HIP_API_ID_CONCAT(HIP_API_ID_,hipGetDeviceProperties),
@@ -546,6 +545,7 @@ static inline const char* hip_api_name(const uint32_t id) {
546545
case HIP_API_ID_hipEventQuery: return "hipEventQuery";
547546
case HIP_API_ID_hipEventRecord: return "hipEventRecord";
548547
case HIP_API_ID_hipEventSynchronize: return "hipEventSynchronize";
548+
case HIP_API_ID_hipExtGetLastError: return "hipExtGetLastError";
549549
case HIP_API_ID_hipExtGetLinkTypeAndHopCount: return "hipExtGetLinkTypeAndHopCount";
550550
case HIP_API_ID_hipExtLaunchKernel: return "hipExtLaunchKernel";
551551
case HIP_API_ID_hipExtLaunchMultiKernelMultiDevice: return "hipExtLaunchMultiKernelMultiDevice";
@@ -859,8 +859,6 @@ static inline const char* hip_api_name(const uint32_t id) {
859859
case HIP_API_ID_hipUserObjectRelease: return "hipUserObjectRelease";
860860
case HIP_API_ID_hipUserObjectRetain: return "hipUserObjectRetain";
861861
case HIP_API_ID_hipWaitExternalSemaphoresAsync: return "hipWaitExternalSemaphoresAsync";
862-
case HIP_API_ID_hipExtGetLastError: return "hipExtGetLastError";
863-
case HIP_API_ID_hipStreamBatchMemOp: return "hipStreamBatchMemOp";
864862
};
865863
return "unknown";
866864
};
@@ -1264,7 +1262,6 @@ static inline uint32_t hipApiIdByName(const char* name) {
12641262
if (strcmp("hipUserObjectRelease", name) == 0) return HIP_API_ID_hipUserObjectRelease;
12651263
if (strcmp("hipUserObjectRetain", name) == 0) return HIP_API_ID_hipUserObjectRetain;
12661264
if (strcmp("hipWaitExternalSemaphoresAsync", name) == 0) return HIP_API_ID_hipWaitExternalSemaphoresAsync;
1267-
if (strcmp("hipStreamBatchMemOp", name) == 0) return HIP_API_ID_hipStreamBatchMemOp;
12681265
return HIP_API_ID_NONE;
12691266
}
12701267

@@ -3626,13 +3623,6 @@ typedef struct hip_api_data_s {
36263623
unsigned int numExtSems;
36273624
hipStream_t stream;
36283625
} hipWaitExternalSemaphoresAsync;
3629-
struct {
3630-
hipStream_t stream;
3631-
unsigned int count;
3632-
hipStreamBatchMemOpParams* paramArray;
3633-
hipStreamBatchMemOpParams paramArray__val;
3634-
unsigned int flags;
3635-
} hipStreamBatchMemOp;
36363626
} args;
36373627
uint64_t *phase_data;
36383628
} hip_api_data_t;
@@ -5902,15 +5892,6 @@ typedef struct hip_api_data_s {
59025892
cb_data.args.hipStreamWriteValue64.value = (uint64_t)value; \
59035893
cb_data.args.hipStreamWriteValue64.flags = (unsigned int)flags; \
59045894
};
5905-
5906-
// hipStreamBatchMemOp[('hipStream_t', 'stream'), ('unsigned int', 'count'),
5907-
// ('hipStreamBatchMemOpParams*', 'paramArray'), ('unsigned int', 'flags')]
5908-
#define INIT_hipStreamBatchMemOp_CB_ARGS_DATA(cb_data) { \
5909-
cb_data.args.hipStreamBatchMemOp.stream = (hipStream_t)stream; \
5910-
cb_data.args.hipStreamBatchMemOp.count = (unsigned int)count; \
5911-
cb_data.args.hipStreamBatchMemOp.paramArray= (hipStreamBatchMemOpParams*)paramArray; \
5912-
cb_data.args.hipStreamBatchMemOp.flags = (unsigned int)flags; \
5913-
};
59145895
// hipTexRefGetAddress[('hipDeviceptr_t*', 'dev_ptr'), ('const textureReference*', 'texRef')]
59155896
#define INIT_hipTexRefGetAddress_CB_ARGS_DATA(cb_data) { \
59165897
cb_data.args.hipTexRefGetAddress.dev_ptr = (hipDeviceptr_t*)dptr; \
@@ -7546,11 +7527,6 @@ static inline void hipApiArgsInit(hip_api_id_t id, hip_api_data_t* data) {
75467527
// hipStreamWriteValue64[('hipStream_t', 'stream'), ('void*', 'ptr'), ('uint64_t', 'value'), ('unsigned int', 'flags')]
75477528
case HIP_API_ID_hipStreamWriteValue64:
75487529
break;
7549-
// hipStreamBatchMemOp[('hipStream_t', 'stream'), ('unsigned int', 'count'),
7550-
// ('hipStreamBatchMemOpParams*', 'paramArray'), ('unsigned int', 'flags')]
7551-
case HIP_API_ID_hipStreamBatchMemOp:
7552-
if (data->args.hipStreamBatchMemOp.paramArray) data->args.hipStreamBatchMemOp.paramArray__val = *(data->args.hipStreamBatchMemOp.paramArray);
7553-
break;
75547530
// hipTexRefGetAddress[('hipDeviceptr_t*', 'dev_ptr'), ('const textureReference*', 'texRef')]
75557531
case HIP_API_ID_hipTexRefGetAddress:
75567532
if (data->args.hipTexRefGetAddress.dev_ptr) data->args.hipTexRefGetAddress.dev_ptr__val = *(data->args.hipTexRefGetAddress.dev_ptr);
@@ -10638,15 +10614,6 @@ static inline const char* hipApiString(hip_api_id_t id, const hip_api_data_t* da
1063810614
oss << ", flags="; roctracer::hip_support::detail::operator<<(oss, data->args.hipStreamWriteValue64.flags);
1063910615
oss << ")";
1064010616
break;
10641-
case HIP_API_ID_hipStreamBatchMemOp:
10642-
oss << "hipStreamBatchMemOp(";
10643-
oss << "stream="; roctracer::hip_support::detail::operator<<(oss, data->args.hipStreamBatchMemOp.stream);
10644-
oss << ", count="; roctracer::hip_support::detail::operator<<(oss, data->args.hipStreamBatchMemOp.count);
10645-
if (data->args.hipStreamBatchMemOp.paramArray == NULL) oss << ", paramArray=NULL";
10646-
else { oss << ", paramArray="; roctracer::hip_support::detail::operator<<(oss, data->args.hipStreamBatchMemOp.paramArray__val); }
10647-
oss << ", flags="; roctracer::hip_support::detail::operator<<(oss, data->args.hipStreamBatchMemOp.flags);
10648-
oss << ")";
10649-
break;
1065010617
case HIP_API_ID_hipTexRefGetAddress:
1065110618
oss << "hipTexRefGetAddress(";
1065210619
if (data->args.hipTexRefGetAddress.dev_ptr == NULL) oss << "dev_ptr=NULL";

hipamd/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ if(WIN32 OR NOT BUILD_SHARED_LIBS)
299299
# rocprofiler-register is not support on Windows
300300
set(HIP_ENABLE_ROCPROFILER_REGISTER OFF)
301301
else()
302-
option(HIP_ENABLE_ROCPROFILER_REGISTER "Enable rocprofiler-register support" ON)
302+
option(HIP_ENABLE_ROCPROFILER_REGISTER "Enable rocprofiler-register support" ON)
303303
endif()
304304

305305
if(HIP_ENABLE_ROCPROFILER_REGISTER)

hipamd/src/amdhip.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,4 +480,3 @@ hipGraphExecNodeSetParams
480480
hipDrvGraphMemcpyNodeSetParams
481481
hipDrvGraphMemcpyNodeGetParams
482482
hipExtHostAlloc
483-
hipStreamBatchMemOp

hipamd/src/hip_api_trace.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,6 @@ hipError_t hipStreamWaitValue64(hipStream_t stream, void* ptr, uint64_t value, u
602602
uint64_t mask);
603603
hipError_t hipStreamWriteValue32(hipStream_t stream, void* ptr, uint32_t value, unsigned int flags);
604604
hipError_t hipStreamWriteValue64(hipStream_t stream, void* ptr, uint64_t value, unsigned int flags);
605-
hipError_t hipStreamBatchMemOp(hipStream_t stream, unsigned int count, hipStreamBatchMemOpParams* paramArray,
606-
unsigned int flags);
607605
hipError_t hipTexObjectCreate(hipTextureObject_t* pTexObject, const HIP_RESOURCE_DESC* pResDesc,
608606
const HIP_TEXTURE_DESC* pTexDesc,
609607
const HIP_RESOURCE_VIEW_DESC* pResViewDesc);
@@ -1199,7 +1197,6 @@ void UpdateDispatchTable(HipDispatchTable* ptrDispatchTable) {
11991197
ptrDispatchTable->hipStreamWaitValue64_fn = hip::hipStreamWaitValue64;
12001198
ptrDispatchTable->hipStreamWriteValue32_fn = hip::hipStreamWriteValue32;
12011199
ptrDispatchTable->hipStreamWriteValue64_fn = hip::hipStreamWriteValue64;
1202-
ptrDispatchTable->hipStreamBatchMemOp_fn = hip::hipStreamBatchMemOp;
12031200
ptrDispatchTable->hipTexObjectCreate_fn = hip::hipTexObjectCreate;
12041201
ptrDispatchTable->hipTexObjectDestroy_fn = hip::hipTexObjectDestroy;
12051202
ptrDispatchTable->hipTexObjectGetResourceDesc_fn = hip::hipTexObjectGetResourceDesc;
@@ -1890,19 +1887,16 @@ HIP_ENFORCE_ABI(HipDispatchTable, hipDrvGraphMemcpyNodeSetParams_fn, 460)
18901887
HIP_ENFORCE_ABI(HipDispatchTable, hipExtHostAlloc_fn, 461)
18911888
// HIP_RUNTIME_API_TABLE_STEP_VERSION == 6
18921889
HIP_ENFORCE_ABI(HipDispatchTable, hipDeviceGetTexture1DLinearMaxWidth_fn, 462)
1893-
// HIP_RUNTIME_API_TABLE_STEP_VERSION == 7
1894-
HIP_ENFORCE_ABI(HipDispatchTable, hipStreamBatchMemOp_fn, 463);
1895-
18961890

18971891
// if HIP_ENFORCE_ABI entries are added for each new function pointer in the table, the number below
18981892
// will be +1 of the number in the last HIP_ENFORCE_ABI line. E.g.:
18991893
//
19001894
// HIP_ENFORCE_ABI(<table>, <functor>, 8)
19011895
//
19021896
// HIP_ENFORCE_ABI_VERSIONING(<table>, 9) <- 8 + 1 = 9
1903-
HIP_ENFORCE_ABI_VERSIONING(HipDispatchTable, 464)
1897+
HIP_ENFORCE_ABI_VERSIONING(HipDispatchTable, 463)
19041898

1905-
static_assert(HIP_RUNTIME_API_TABLE_MAJOR_VERSION == 0 && HIP_RUNTIME_API_TABLE_STEP_VERSION == 7,
1899+
static_assert(HIP_RUNTIME_API_TABLE_MAJOR_VERSION == 0 && HIP_RUNTIME_API_TABLE_STEP_VERSION == 6,
19061900
"If you get this error, add new HIP_ENFORCE_ABI(...) code for the new function "
19071901
"pointers and then update this check so it is true");
19081902
#endif

hipamd/src/hip_hcc.map.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,6 @@ local:
583583
hip_6.3 {
584584
global:
585585
hipExtHostAlloc;
586-
hipStreamBatchMemOp;
587586
local:
588587
*;
589588
} hip_6.2;

hipamd/src/hip_stream_ops.cpp

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,8 @@
2323
#include "platform/command_utils.hpp"
2424

2525
namespace hip {
26-
hipError_t ihipBatchMemOperation(hipStream_t stream, cl_command_type cmdType, unsigned int count,
27-
hipStreamBatchMemOpParams* paramArray, unsigned int flags) {
28-
if (paramArray == nullptr || flags != 0 || count > 256) {
29-
return hipErrorInvalidValue;
30-
}
31-
32-
if (!hip::isValid(stream)) {
33-
return hipErrorContextIsDestroyed;
34-
}
35-
36-
hip::Stream* hip_stream = hip::getStream(stream);
37-
amd::Command::EventWaitList waitList;
38-
39-
amd::BatchMemoryOperationCommand* command =
40-
new amd::BatchMemoryOperationCommand(*hip_stream, cmdType, count,
41-
flags, waitList, paramArray,
42-
sizeof(hipStreamBatchMemOpParams));
43-
44-
if (command == nullptr) {
45-
return hipErrorOutOfMemory;
46-
}
47-
command->enqueue();
48-
command->release();
49-
HIP_RETURN(hipSuccess);
50-
}
51-
52-
5326
hipError_t ihipStreamOperation(hipStream_t stream, cl_command_type cmdType, void* ptr,
54-
uint64_t value, uint64_t mask, unsigned int flags,
55-
size_t sizeBytes) {
27+
uint64_t value, uint64_t mask, unsigned int flags, size_t sizeBytes) {
5628
size_t offset = 0;
5729
unsigned int outFlags = 0;
5830

@@ -164,15 +136,4 @@ hipError_t hipStreamWriteValue64(hipStream_t stream, void* ptr, uint64_t value,
164136
0, // flags un-used for now set it to 0
165137
sizeof(uint64_t)));
166138
}
167-
168-
hipError_t hipStreamBatchMemOp(hipStream_t stream, unsigned int count,
169-
hipStreamBatchMemOpParams* paramArray, unsigned int flags) {
170-
HIP_INIT_API(hipStreamBatchMemOp, count, paramArray, flags);
171-
HIP_RETURN_DURATION(ihipBatchMemOperation(
172-
stream,
173-
ROCCLR_COMMAND_BATCH_STREAM,
174-
count,
175-
paramArray,
176-
flags));
177-
}
178139
} // namespace hip

hipamd/src/hip_table_interface.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,10 +1413,6 @@ hipError_t hipStreamWriteValue64(hipStream_t stream, void* ptr, uint64_t value,
14131413
unsigned int flags) {
14141414
return hip::GetHipDispatchTable()->hipStreamWriteValue64_fn(stream, ptr, value, flags);
14151415
}
1416-
hipError_t hipStreamBatchMemOp(hipStream_t stream, unsigned int count,
1417-
hipStreamBatchMemOpParams* paramArray, unsigned int flags) {
1418-
return hip::GetHipDispatchTable()->hipStreamBatchMemOp_fn(stream, count, paramArray, flags);
1419-
}
14201416
hipError_t hipTexObjectCreate(hipTextureObject_t* pTexObject, const HIP_RESOURCE_DESC* pResDesc,
14211417
const HIP_TEXTURE_DESC* pTexDesc,
14221418
const HIP_RESOURCE_VIEW_DESC* pResViewDesc) {

rocclr/device/blit.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,6 @@ class BlitManager : public amd::HeapObject {
233233
uint64_t mask
234234
) const = 0;
235235

236-
//! Stream batch memory operation
237-
virtual bool batchMemOps(const void* paramArray,
238-
size_t paramSize,
239-
uint32_t count
240-
) const = 0;
241-
242236
//! Enables synchronization on blit operations
243237
void enableSynchronization() { syncOperation_ = true; }
244238

rocclr/device/blitcl.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ const char* BlitLinearSourceCode = BLIT_KERNELS(
4343

4444
extern void __amd_streamOpsWait(__global uint*, __global ulong*, ulong, ulong, ulong);
4545

46-
extern void __amd_batchMemOp(__global void*, uint count);
47-
4846
extern void __ockl_dm_init_v1(ulong, ulong, uint, uint);
4947

5048
extern void __ockl_gws_init(uint nwm1, uint rid);
@@ -164,10 +162,6 @@ const char* BlitLinearSourceCode = BLIT_KERNELS(
164162
ulong4 srcRect, ulong4 dstRect, ulong4 size) {
165163
__amd_copyBufferRectAligned(src, dst, srcRect, dstRect, size);
166164
}
167-
168-
__kernel void __amd_rocclr_batchMemOp(__global void* params, uint count) {
169-
__amd_batchMemOp(params, count);
170-
}
171165
);
172166

173167
const char* HipExtraSourceCode = BLIT_KERNELS(
@@ -260,6 +254,7 @@ const char* BlitImageSourceCode = BLIT_KERNELS(
260254
__amd_copyImageToBuffer(src, dstUInt, dstUShort, dstUChar, srcOrigin, dstOrigin, size, format,
261255
pitch);
262256
}
257+
263258
);
264259

265260
} // namespace amd::device

0 commit comments

Comments
 (0)