Skip to content

Commit 732dd49

Browse files
committed
Remove checksum
1 parent 3a669db commit 732dd49

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

src/provider/provider_level_zero.c

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -755,21 +755,9 @@ static umf_result_t ze_memory_provider_allocation_split(void *provider,
755755
typedef struct ze_ipc_data_t {
756756
int pid;
757757
uint64_t id; // Unique identifier for the IPC handle
758-
uint64_t checksum;
759758
ze_ipc_mem_handle_t ze_handle;
760759
} ze_ipc_data_t;
761760

762-
// Compute a simple checksum of the ze_handle field in ze_ipc_data_t
763-
static uint64_t ze_ipc_handle_checksum(const ze_ipc_data_t *ipc_data) {
764-
// Interpret the ze_handle as a byte array
765-
const uint8_t *bytes = (const uint8_t *)&ipc_data->ze_handle;
766-
uint64_t checksum = 0;
767-
for (size_t i = 0; i < sizeof(ipc_data->ze_handle); ++i) {
768-
checksum += bytes[i];
769-
}
770-
return checksum;
771-
}
772-
773761
static umf_result_t ze_memory_provider_get_ipc_handle_size(void *provider,
774762
size_t *size) {
775763
(void)provider;
@@ -799,11 +787,10 @@ static umf_result_t ze_memory_provider_get_ipc_handle(void *provider,
799787
}
800788

801789
ze_ipc_data->pid = utils_getpid();
802-
ze_ipc_data->checksum = ze_ipc_handle_checksum(ze_ipc_data);
803790
ze_ipc_data->id = id++;
804791

805-
LOG_DEBUG("GET handle(): pid = %d, id = %lu, checksum = %lu", ze_ipc_data->pid,
806-
ze_ipc_data->id, ze_ipc_data->checksum);
792+
LOG_DEBUG("GET handle(): pid = %d, id = %lu", ze_ipc_data->pid,
793+
ze_ipc_data->id);
807794

808795
return UMF_RESULT_SUCCESS;
809796
}
@@ -822,15 +809,8 @@ static umf_result_t ze_memory_provider_put_ipc_handle(void *provider,
822809
return UMF_RESULT_SUCCESS;
823810
}
824811

825-
if (ze_ipc_data->checksum != ze_ipc_handle_checksum(ze_ipc_data)) {
826-
LOG_FATAL(
827-
"Checksum mismatch for IPC handle data: pid = %d, checksum = %lu",
828-
ze_ipc_data->pid, ze_ipc_data->checksum);
829-
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
830-
}
831-
832-
LOG_DEBUG("PUT handle(): pid = %d, id = %lu, checksum = %lu", ze_ipc_data->pid,
833-
ze_ipc_data->id, ze_ipc_data->checksum);
812+
LOG_DEBUG("PUT handle(): pid = %d, id = %lu", ze_ipc_data->pid,
813+
ze_ipc_data->id);
834814

835815
ze_result = g_ze_ops.zeMemPutIpcHandle(ze_provider->context,
836816
ze_ipc_data->ze_handle);

0 commit comments

Comments
 (0)