@@ -874,26 +874,13 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
874
874
// Allocations for each kernel
875
875
kern->accel_csr = (acl_kernel_if_addr_range *)acl_malloc (
876
876
kern->num_accel * sizeof (acl_kernel_if_addr_range));
877
- if (!(kern->accel_csr )) {
878
- ACL_KERNEL_IF_DEBUG_MSG (kern,
879
- " Failed to allocate memory for kernel csr.\n " );
880
- return 1 ;
881
- }
877
+ assert (kern->accel_csr );
882
878
kern->accel_perf_mon = (acl_kernel_if_addr_range *)acl_malloc (
883
879
kern->num_accel * sizeof (acl_kernel_if_addr_range));
884
- if (!(kern->accel_perf_mon )) {
885
- ACL_KERNEL_IF_DEBUG_MSG (
886
- kern, " Failed to allocate memory for kernel performance monitor.\n " );
887
- return 1 ;
888
- }
880
+ assert (kern->accel_perf_mon );
889
881
kern->accel_num_printfs =
890
882
(unsigned int *)acl_malloc (kern->num_accel * sizeof (unsigned int ));
891
- if (!(kern->accel_num_printfs )) {
892
- ACL_KERNEL_IF_DEBUG_MSG (
893
- kern,
894
- " Failed to allocate memory for kernel number of printf tracker.\n " );
895
- return 1 ;
896
- }
883
+ assert (kern->accel_num_printfs );
897
884
898
885
// The Kernel CSR registers
899
886
// The new and improved config ROM give us the address *offsets* from
@@ -962,35 +949,18 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
962
949
if (kern->num_accel > 0 ) {
963
950
kern->accel_job_ids =
964
951
(int volatile **)acl_malloc (kern->num_accel * sizeof (int *));
965
- if (!(kern->accel_job_ids )) {
966
- ACL_KERNEL_IF_DEBUG_MSG (kern,
967
- " Failed to allocate memory for kernel id.\n " );
968
- return 1 ;
969
- }
952
+ assert (kern->accel_job_ids )
970
953
971
954
kern->accel_invoc_queue_depth =
972
955
(unsigned int *)acl_malloc (kern->num_accel * sizeof (unsigned int ));
973
- if (!(kern->accel_invoc_queue_depth )) {
974
- ACL_KERNEL_IF_DEBUG_MSG (
975
- kern,
976
- " Failed to allocate memory for kernel invocation queue depth.\n " );
977
- return 1 ;
978
- }
956
+ assert (kern->accel_invoc_queue_depth )
979
957
980
958
// Kernel IRQ is a separate thread. Need to use circular buffer to make this
981
959
// multithread safe.
982
960
kern->accel_queue_front = (int *)acl_malloc (kern->num_accel * sizeof (int ));
983
- if (!(kern->accel_queue_front )) {
984
- ACL_KERNEL_IF_DEBUG_MSG (
985
- kern, " Failed to allocate memory for kernel IRQ circular buffer.\n " );
986
- return 1 ;
987
- }
961
+ assert (kern->accel_queue_front )
988
962
kern->accel_queue_back = (int *)acl_malloc (kern->num_accel * sizeof (int ));
989
- if (!(kern->accel_queue_back )) {
990
- ACL_KERNEL_IF_DEBUG_MSG (
991
- kern, " Failed to allocate memory for kernel IRQ circular buffer.\n " );
992
- return 1 ;
993
- }
963
+ assert (kern->accel_queue_back )
994
964
995
965
for (unsigned a = 0 ; a < kern->num_accel ; ++a) {
996
966
unsigned int max_same_accel_launches =
0 commit comments