summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d7e05d)
raw | patch | inline | side by side (parent: 6d7e05d)
author | Jianzhong Xu <a0869574local@uda0869574> | |
Tue, 6 Oct 2015 13:18:26 +0000 (09:18 -0400) | ||
committer | Jianzhong Xu <a0869574local@uda0869574> | |
Tue, 6 Oct 2015 13:18:26 +0000 (09:18 -0400) |
33 files changed:
index 0431d63aa62f52e0d6115bc8670a21d1a53a4d62..4d49ae45c9ed6cd25c79da6be107ce3e8efdcdbf 100644 (file)
--- a/blasblisacc/src/Makefile
+++ b/blasblisacc/src/Makefile
ifneq (,$(findstring 86, $(UNAME_M)))
$(eval $(call FIND_DSP_PKG,C6636_PDK_DIR,pdk_keystone2*,packages))
endif
+
+$(eval $(call FIND_DSP_PKG,FC_DIR,framework_components*,packages))
+$(eval $(call FIND_DSP_PKG,LIBARCH_DIR,libarch*,packages))
+$(eval $(call FIND_DSP_PKG,XDAIS_DIR,xdais*,packages))
+$(eval $(call FIND_DSP_PKG,XDC_DIR,xdc*,packages))
+
INCDIR := $(TI_OCL_CGT_INSTALL)/include;$(TARGET_ROOTDIR)/usr/include;../../blis/install/c66x/include/blis/;$(OMP_DIR)/packages/ti/runtime/openmp;$(PDK_DIR)/packages
+INCDIR += -I$(FC_DIR)/packages
+INCDIR += -I$(XDC_DIR)/packages
+INCDIR += -I$(XDAIS_DIR)/packages
+INCDIR += -I$(LIBARCH_DIR)/packages
INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),$(space),$(INCDIR))))
OBJS = ti_cblas_initfini.o
index 8e9d87baf59ac9decdfff946179f9cb03092b80a..6cd8a3e48450e3b710f6ab7cb1e0ff65e86f0898 100755 (executable)
#include "c6x.h"
#include <ti/csl/device/k2h/src/cslr_device.h>
-#include <ti/csl/csl_chipAux.h> // CSL_chipReadDNUM -> to read coreID
+#include <ti/libarch/libarch.h>
+
+#include <ti/csl/csl_chipAux.h> // lib_get_coreID -> to read coreID
#include <ti/csl/csl_cacheAux.h> // CACHE_invL1d
// -- EDMA ---------------------------------------------------------------------
#define BLIS_ENABLE_C66X_EDMA
#ifdef BLIS_ENABLE_C66X_EDMA
-#include "edmamgr.h"
+//#include "edmamgr.h"
//#include <ti/sdo/fc/edmamgr/edmamgr.h>
#define BLIS_C66X_MAXDMASTRIDE 0x7FFF
index 920d06c76e57e7c3e72a71f4db48def3cd31bb9a..7257fdb1a9f29f3997914f58e7ec5a0dd38964b1 100755 (executable)
$(eval $(call FIND_DSP_PKG,FC_DIR,framework_components*,packages))
$(eval $(call FIND_DSP_PKG,OMP_DIR,openmp_dsp*,packages))
-#$(eval $(call FIND_DSP_PKG,C6636_PDK_DIR,pdk_keystone2*,packages))
-
+$(eval $(call FIND_DSP_PKG,LIBARCH_DIR,libarch*,packages))
+$(eval $(call FIND_DSP_PKG,XDAIS_DIR,xdais*,packages))
+$(eval $(call FIND_DSP_PKG,XDC_DIR,xdc*,packages))
#
#CMISCFLAGS += -I$(TI_OCL_CGT_INSTALL)/include
CMISCFLAGS += -I$(OMP_DIR)/packages/ti/runtime/openmp
CMISCFLAGS += -I$(FC_DIR)/packages
+CMISCFLAGS += -I$(C6636_PDK_DIR)/packages
+CMISCFLAGS += -I$(XDC_DIR)/packages
+CMISCFLAGS += -I$(XDAIS_DIR)/packages
+CMISCFLAGS += -I$(LIBARCH_DIR)/packages
#CMISCFLAGS += -I$(C6636_PDK_DIR)/packages
CMISCFLAGS += -I$(LINUX_DEVKIT_ROOT)/usr/share/ti/cgt-c6x/include
ifneq (,$(findstring 86, $(UNAME_M)))
-CMISCFLAGS += -I$(C6636_PDK_DIR)/packages
$(info Using $(UNAME_M))
else
CMISCFLAGS += -I$(LINUX_DEVKIT_ROOT)/usr/include
index fc6123e4897147a50f1af2ecddad95754ff06cea..da5ce77d8a6de486a1d28c026743b9003dd0b9cb 100644 (file)
bli_obj_release_pack( b_pack , cntl_sub_packm_b( cntl ));
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( b_dma , cntl_sub_dmam_b( cntl ) );
- bli_obj_release_edma_handle( b_dma );
+ bli_obj_release_emt_handle( b_dma );
#endif
}
if( thread_am_ichief( thread ) ){
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma , cntl_sub_dmam_a( cntl ));
bli_obj_release_dma( c1_dma , cntl_sub_dmam_c( cntl ) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( c1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( c1_dma );
#endif
}
}
index fb40fdd09368f7d1e1a26ac63df2a9a889adbbcd..bed1e05240f5e8d8165ac7bec367c55a3b8a977f 100644 (file)
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma , cntl_sub_dmam_a( cntl ));
bli_obj_release_dma( b1_dma , cntl_sub_dmam_b( cntl ) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( b1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( b1_dma );
#endif
bli_obj_release_pack( a1_pack, cntl_sub_packm_a( cntl ) );
// printf("blk var 3 b1_pack before release %x\n", bli_mem_buffer(&(b1_pack->pack_mem)));
index 000a7a4e251401116f680acb4eece5ac85dd1a66..c46b814b312d290ef7dde5603d72508c5983d484 100644 (file)
thread );
#ifdef BLIS_ENABLE_CYCLE_COUNT_BLIS_GEMM_INT
counter_end = TSCL;
- if(CSL_chipReadDNUM()==0) printf("xxxxx bli_gemm_int %d %d %d\n", n, i, counter_end-counter_start);
+ if(lib_get_coreID()==0) printf("xxxxx bli_gemm_int %d %d %d\n", n, i, counter_end-counter_start);
#endif
}
index 55280e6b18b384b61ae43ab76286d36704d9072a..b76494cb44e60ebd1fadf008df5f968211934ffc 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp; \
/*EDMA Declarations */ \
\
- EdmaMgr_Handle edma_handle_b = NULL; \
- EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL; \
+ lib_emt_Handle emt_handle_b = NULL; \
+ lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL; \
\
/*For DSP timing*/ \
/*volatile int counter_start; \
cNew2 = bli_mem_buffer( &c2_L2_mem ); \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle B CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle B CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
\
/*For DSP Timing*/ \
/* initiate first c transfer */ \
n_cur = ( bli_is_not_edge_f( jr_thread_id, n_iter, n_left ) ? NR : n_left ); \
if(cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c_cast+jr_thread_id*cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c_cast+jr_thread_id*cstep_c, \
cNew1, m*sizeof(ctype), /*(m_iter-ir_thread_id)*sizeof(ctype)*MR,*/ \
n_cur, cs_c*sizeof(ctype), cs_c11*sizeof(ctype)); \
else \
if (j == jr_thread_id) \
{ \
/*Always use MR and NR while transfering a packed panel*/ \
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
- idma1_setup(a2_L1, a1 = a_cast + ir_thread_id * rstep_a, k*MR*sizeof(ctype), 0, 0, 7);\
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
+ lib_imt_copy(a1 = a_cast + ir_thread_id * rstep_a, a2_L1, k*MR*sizeof(ctype));\
} \
/* wait for previous c transfer to complete and initiate next transfer */ \
- EdmaMgr_wait(edma_handle_c0); \
+ lib_emt_wait(emt_handle_c0); \
if(j < (n_iter-jr_num_threads)) /* no transfer for last iteration */ \
{\
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1+jr_num_threads*cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1+jr_num_threads*cstep_c, \
cNew0, m*sizeof(ctype), /*(m_iter-ir_thread_id)*sizeof(ctype)*MR,*/ \
n_next, cs_c*sizeof(ctype), \
cs_c11*sizeof(ctype)); \
a2_L1 = temp; \
\
/*Wait for the panel to finish transferring*/ \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
if ( bli_is_last_iter( i, m_iter, ir_thread_id, ir_num_threads ) ) \
{ \
- idma1_setup(a2_L1, a1 = a_cast + ir_thread_id * rstep_a, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1 = a_cast + ir_thread_id * rstep_a, a2_L1, k*MR*sizeof(ctype)); \
a2 = a_cast; \
b2 = gemm_get_next_b_micropanel( thread, b1, cstep_b ); \
if ( bli_is_last_iter( j, n_iter, jr_thread_id, jr_num_threads ) ) \
} \
else \
{ \
- idma1_setup(a2_L1, a2, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k*MR*sizeof(ctype)); \
} \
\
if(i == ir_thread_id) \
{ \
- EdmaMgr_wait(edma_handle_b); \
+ lib_emt_wait(emt_handle_b); \
} \
/* Handle interior and edge cases separately. */ \
if ( m_cur == MR && n_cur == NR ) \
if(!bli_is_last_iter( j, n_iter, jr_thread_id, jr_num_threads ) && bli_is_last_iter( i, m_iter, ir_thread_id, ir_num_threads )) \
{ \
/* Start the EDMA of the next panel (K*NR) of B*/ \
- EdmaMgr_copy1D1D(edma_handle_b, b2, b1_L1, k*NR*sizeof(ctype)); \
+ lib_emt_copy1D1D(emt_handle_b, b2, b1_L1, k*NR*sizeof(ctype)); \
} \
} \
/* circularly shift buffers */ \
cNew1 = cNewTemp; \
if(j != jr_thread_id) /* wait for save c to complete; skip first iteration */ \
{ \
- EdmaMgr_wait(edma_handle_c1); \
+ lib_emt_wait(emt_handle_c1); \
} \
/* save updated c */ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew2, c1, m*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew2, c1, m*sizeof(ctype), \
n_cur, cs_c11*sizeof(ctype), cs_c*sizeof(ctype)); \
else \
{\
} \
/*For DSP timing*/ \
/*counter_end=TSCL; \
- if (CSL_chipReadDNUM () == 0) */\
+ if (lib_get_coreID () == 0) */\
/*printf("%d %d %d\t%d\n",n_iter, m_iter, k, counter_end-counter_start); */\
/* Loop over the n dimension (NR columns at a time). */ \
bli_mem_release( &c2_L2_mem ); \
bli_mem_release( &a2_L1_mem ); \
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
- if ( edma_handle_c0 != NULL ) \
+ if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); /* wait for save c to complete */ \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); /* wait for save c to complete */ \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
/*PASTEMAC(ch,fprintm)( stdout, "gemm_ker_var2: b1", k, NR, b1, NR, 1, "%4.1f", "" ); \
PASTEMAC(ch,fprintm)( stdout, "gemm_ker_var2: a1", MR, k, a1, 1, MR, "%4.1f", "" );*/ \
index c21db299f352ee192ff091377224dff191565357..3a34f9de36351991d307ddec054c5664226eff20 100644 (file)
bli_obj_release_pack( ah_pack, cntl_sub_packm_b( cntl ) );
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( ah_dma , cntl_sub_dmam_b( cntl ));
- bli_obj_release_edma_handle( ah_dma );
+ bli_obj_release_emt_handle( ah_dma );
#endif
}
if( thread_am_ichief( thread ) )
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma, cntl_sub_dmam_a( cntl ) );
bli_obj_release_dma( c1_dma, cntl_sub_dmam_c( cntl ) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( c1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( c1_dma );
#endif
}
}
index 6156488688ffb71ae3dcf65072141d5fb6d75193..7d28287c82e2f5c5360aabbaef4b994c976c6ea8 100644 (file)
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma, cntl_sub_dmam_a( cntl ) );
bli_obj_release_dma( ah1_dma, cntl_sub_dmam_b( cntl ) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( ah1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( ah1_dma );
#endif
bli_obj_release_pack( a1_pack, cntl_sub_packm_a( cntl ));
bli_obj_release_pack( ah1_pack, cntl_sub_packm_b( cntl ) );
index 01fb8c983dae5dbe5364533ddb4603b60108c786..ac0744ff062c009fbd77dca695876a50960bccf1 100644 (file)
thread );
#ifdef BLIS_ENABLE_CYCLE_COUNT_BLIS_GEMM_INT
counter_end = TSCL;
- if(CSL_chipReadDNUM ()==0) printf("xxxxx bli_gemm_int \t %d %d %d \t %d\n", uplo, n, i, counter_end-counter_start);
+ if(lib_get_coreID ()==0) printf("xxxxx bli_gemm_int \t %d %d %d \t %d\n", uplo, n, i, counter_end-counter_start);
#endif
}
index fb01f90853af6850416e06c52f9f5ae567d5e0ef..9e2815b10d1f8b531874b827ee0f8ad232b10a6a 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp; \
/*EDMA Declarations */ \
\
- EdmaMgr_Handle edma_handle_b = NULL; \
- EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL; \
+ lib_emt_Handle emt_handle_b = NULL; \
+ lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL; \
\
/*volatile int counter_start; \
volatile int counter_end;*/ \
cNew2 = bli_mem_buffer( &c2_L2_mem ); \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle CoreID %d \n", lib_get_coreID()); \
} \
- bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
\
{ \
* values of C written back.*/ \
n_cur = ( bli_is_not_edge_f( jr_thread_id, n_iter, n_left ) ? NR : n_left ); \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1_new, \
+ lib_emt_copy2D2D(emt_handle_c0, c1_new, \
cNew1, mc_new*sizeof(ctype), \
n_cur, cs_c*sizeof(ctype), cs_c11*sizeof(ctype)); \
else \
n_next = ( bli_is_not_edge_f( j+jr_num_threads, n_iter, n_left ) ? NR : n_left ); \
\
/*Start EDMA of KCxNR panel of B*/\
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
\
/* Initialize our next panel of B to be the current panel of B. */ \
b2 = b1; \
/*IDMA the first block of A only if it below the diagonal*/ \
m_cur = ( bli_is_not_edge_f( i, m_iter_new, m_left_new ) ? MR : m_left_new ); \
if (!bli_is_strictly_above_diag_n( diagoffc_j + (doff_t)ir_thread_id*MR, n_cur, m_cur )) \
- idma1_setup(a2_L1, a1_new + ir_thread_id * rstep_a, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1_new + ir_thread_id * rstep_a, a2_L1, k*MR*sizeof(ctype)); \
\
/* wait for previous c transfer to complete and initiate next transfer */ \
- EdmaMgr_wait(edma_handle_c0); \
+ lib_emt_wait(emt_handle_c0); \
if(j < (n_iter-jr_num_threads)) /* no transfer for last iteration */ \
{\
/* Compute the diagonal offset for the next MCxNR bloc of C at (MC,j+jr_num_threads). */ \
cs_c11_next = (mc_next%2 == 0) ? mc_next : mc_next+1; /*(m_iter_next-ir_thread_id)*MR;*/ \
} \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1_next, \
+ lib_emt_copy2D2D(emt_handle_c0, c1_next, \
cNew0, mc_next*sizeof(ctype), \
n_next, cs_c*sizeof(ctype), \
cs_c11_next*sizeof(ctype)); \
} \
/*If EDMA-ing the whole MCXNR panel of C*/ \
/*c1_next = c_cast + (j+jr_num_threads) * cstep_c; \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1_next, \
+ lib_emt_copy2D2D(emt_handle_c0, c1_next, \
cNew0, m*sizeof(ctype), \
n_next, cs_c*sizeof(ctype), \
cs_c11*sizeof(ctype));*/ \
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = herk_get_next_a_micropanel( caucus, a1, rstep_a ); \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
{ \
/*Start next panel*/ \
if (!bli_is_strictly_above_diag_n( diagoffc_ij_next, m_next, n_cur )) \
- idma1_setup(a2_L1, a2, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k*MR*sizeof(ctype)); \
} \
if(i == ir_thread_id) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
} \
} \
/*counter_end=TSCL; \
- if (CSL_chipReadDNUM () == 0) \
+ if (lib_get_coreID () == 0) \
printf("%d %d %d\t%d\n",n_cur, m_cur, k, counter_end-counter_start); */\
} \
/* circularly shift buffers */ \
cNew1 = cNewTemp; \
if(j != jr_thread_id) /* wait for save c to complete; skip first iteration */ \
{ \
- EdmaMgr_wait(edma_handle_c1); \
+ lib_emt_wait(emt_handle_c1); \
} \
/* save updated c */ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew2, c1_new, mc_new*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew2, c1_new, mc_new*sizeof(ctype), \
n_cur, cs_c11*sizeof(ctype), cs_c*sizeof(ctype)); \
else \
{ \
bli_mem_release( &a2_L1_mem ); \
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
- if ( edma_handle_c0 != NULL ) \
+ if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); /* wait for save c to complete */ \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); /* wait for save c to complete */ \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
}
index 1edb8183f4df98fe8bc2b5b49f5ebbc0893e1a54..04e1902eb56a005b61576b23e75ae637a2699824 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp; \
/*EDMA Declarations */ \
\
- EdmaMgr_Handle edma_handle_b = NULL; \
- EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL; \
+ lib_emt_Handle emt_handle_b = NULL; \
+ lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL; \
\
/*
Assumptions/assertions:
cNew2 = bli_mem_buffer( &c2_L2_mem ); \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle CoreID %d \n", lib_get_coreID()); \
} \
- bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
\
/* initiate first c transfer */ \
n_cur = ( bli_is_not_edge_f( jr_thread_id, n_iter, n_left ) ? NR : n_left ); \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c_cast+jr_thread_id*cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c_cast+jr_thread_id*cstep_c, \
cNew1, m*sizeof(ctype), \
n_cur, cs_c*sizeof(ctype), cs_c11*sizeof(ctype)); \
}\
/* Initialize our next panel of B to be the current panel of B. */ \
b2 = b1; \
\
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
- idma1_setup(a2_L1, a_cast + ir_thread_id * rstep_a, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
+ lib_imt_copy(a_cast + ir_thread_id * rstep_a, a2_L1, k*MR*sizeof(ctype)); \
/* wait for previous c transfer to complete and initiate next transfer */ \
- EdmaMgr_wait(edma_handle_c0); \
+ lib_emt_wait(emt_handle_c0); \
if(j < (n_iter-jr_num_threads)) /* no transfer for last iteration */ \
{ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1+jr_num_threads*cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1+jr_num_threads*cstep_c, \
cNew0, m*sizeof(ctype), /*(m_iter-ir_thread_id)*sizeof(ctype)*MR,*/ \
n_next, cs_c*sizeof(ctype), \
cs_c11*sizeof(ctype)); \
a1_L1 = a2_L1; \
a2_L1 = temp; \
/*a1 = a2; Make the next panel the current panel for the next iteration*/ \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
if ( bli_is_last_iter( i, m_iter, ir_thread_id, ir_num_threads ) ) \
{ \
a2 = a_cast; \
else \
{\
/*Start next panel*/ \
- idma1_setup(a2_L1, a2, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k*MR*sizeof(ctype)); \
}\
if(i == ir_thread_id) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
cNew1 = cNewTemp; \
if(j != jr_thread_id) /* wait for save c to complete; skip first iteration */ \
{ \
- EdmaMgr_wait(edma_handle_c1); \
+ lib_emt_wait(emt_handle_c1); \
} \
/* save updated c */ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew2, c1, m*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew2, c1, m*sizeof(ctype), \
n_cur, cs_c11*sizeof(ctype), cs_c*sizeof(ctype)); \
} \
else \
bli_mem_release( &a2_L1_mem ); \
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
- if ( edma_handle_c0 != NULL ) \
+ if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); /* wait for save c to complete */ \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); /* wait for save c to complete */ \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
}
index 02217c237fe1c73002dad610fb4ada515cf7da8b..899dd768ff96de8dbb49e2e2259afa6a39dd6706 100644 (file)
bli_obj_release_pack( b_pack, cntl_sub_packm_b( cntl ));
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( b_dma, cntl_sub_dmam_b( cntl ) );
- bli_obj_release_edma_handle( b_dma );
+ bli_obj_release_emt_handle( b_dma );
#endif
}
if( thread_am_ichief( thread ) )
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma, cntl_sub_dmam_a( cntl ) );
bli_obj_release_dma( c1_dma, cntl_sub_dmam_c( cntl ) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( c1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( c1_dma );
#endif
}
}
index eee25c115fbeb4169b133459a7bc223cc35a64ed..f50a2b2ebd2d4a10f5a9617ea3b3691a98e823fc 100644 (file)
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma, cntl_sub_dmam_a(cntl) );
bli_obj_release_dma( b1_dma, cntl_sub_dmam_b(cntl) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( b1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( b1_dma );
#endif
bli_obj_release_pack( a1_pack, cntl_sub_packm_a( cntl ) );
bli_obj_release_pack( b1_pack, cntl_sub_packm_b( cntl ) );
index b14394b0ff821162b499b3640c80554ba693cca7..0d7cee4021a8400a74038e7a749f339f00fe7aed 100644 (file)
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma , cntl_sub_dmam_a(cntl) );
bli_obj_release_dma( b1_dma , cntl_sub_dmam_b(cntl) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( b1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( b1_dma );
#endif
bli_obj_release_pack( a1_pack, cntl_sub_packm_a(cntl) );
bli_obj_release_pack( b1_pack, cntl_sub_packm_b(cntl) );
index 26a0fced5bc241edf403bf94e301abb802619f02..b48d0f9f4277a76ffa59e845d87533c3affb3184 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp; \
\
/*EDMA Declarations */ \
- EdmaMgr_Handle edma_handle_b = NULL; \
- EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL; \
+ lib_emt_Handle emt_handle_b = NULL; \
+ lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL; \
\
/*
Assumptions/assertions:
cNew2 = bli_mem_buffer( &c2_L2_mem ); \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
\
n_cur = ( bli_is_not_edge_f( 0, n_iter, n_left ) ? NR : n_left ); \
/* Transfering MC(=m)xNR*/ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1, \
+ lib_emt_copy2D2D(emt_handle_c0, c1, \
cNew1, m*sizeof(ctype), \
n_cur, cs_c*sizeof(ctype), cs_c11*sizeof(ctype)); \
}\
b2 = b1; \
\
/*Does not work when transfer k*n_cur*sizeof(ctype)*/ \
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
\
- EdmaMgr_wait(edma_handle_c0); \
+ lib_emt_wait(emt_handle_c0); \
if(j < n_iter-1) /* no transfer for last iteration*/ \
{ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1+cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1+cstep_c, \
cNew0, m*sizeof(ctype), \
n_next, cs_c*sizeof(ctype), \
cs_c11*sizeof(ctype)); \
*/ \
if (bli_intersects_diag_n( diagoffa_i, MR, k )) \
{ \
- idma1_setup(a2_L1, a1, bli_min( diagoffa_i + MR, k )*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, bli_min( diagoffa_i + MR, k )*MR*sizeof(ctype)); \
}\
else \
{ \
- idma1_setup(a2_L1, a1, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, k*MR*sizeof(ctype)); \
} \
} \
/* If the current panel of A intersects the diagonal, scale C
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + ps_a_cur; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
temp = a1_L1; \
a1_L1 = a2_L1; \
b2 = b_cast; \
} \
else \
- idma1_setup(a2_L1, a2, k_next*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k_next*MR*sizeof(ctype)); \
\
/* Save addresses of next panels of A and B to the auxinfo_t
object. */ \
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
temp = a1_L1; \
a1_L1 = a2_L1; \
b2 = b_cast; \
} \
else \
- idma1_setup(a2_L1, a2, k_next*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k_next*MR*sizeof(ctype)); \
\
/* Save addresses of next panels of A and B to the auxinfo_t
object. */ \
cNew1 = cNewTemp; \
if(j != 0) /* wait for save c to complete; skip first iteration */ \
{ \
- EdmaMgr_wait(edma_handle_c1); \
+ lib_emt_wait(emt_handle_c1); \
} \
/* save updated c*/ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew2, c1, m*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew2, c1, m*sizeof(ctype), \
n_cur, cs_c11*sizeof(ctype), cs_c*sizeof(ctype)); \
else \
{ \
bli_mem_release( &a2_L1_mem ); \
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
- if ( edma_handle_c0 != NULL ) \
+ if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); /* wait for save c to complete */ \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); /* wait for save c to complete */ \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
/*PASTEMAC(ch,fprintm)( stdout, "trmm_ll_ker_var2: a1", MR, k_a1011, a1, 1, MR, "%4.1f", "" );*/ \
/*PASTEMAC(ch,fprintm)( stdout, "trmm_ll_ker_var2: b1", k_a1011, NR, b1_i, NR, 1, "%4.1f", "" );*/ \
index f0a555b7a4f28758c899b1af33857311c3be1797..3360f36d6494740cbce5ea501edd5cc4bde350d3 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp; \
\
/*EDMA Declarations */ \
- EdmaMgr_Handle edma_handle_b = NULL; \
- EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL; \
+ lib_emt_Handle emt_handle_b = NULL; \
+ lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL; \
\
/*
Assumptions/assertions:
cNew2 = bli_mem_buffer( &c2_L2_mem ); \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
\
n_cur = ( bli_is_not_edge_f( 0, n_iter, n_left ) ? NR : n_left ); \
/* Transfering MC(=m)xNR*/ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1, \
+ lib_emt_copy2D2D(emt_handle_c0, c1, \
cNew1, m*sizeof(ctype), \
n_cur, cs_c*sizeof(ctype), cs_c11*sizeof(ctype)); \
} \
/* Initialize our next panel of B to be the current panel of B. */ \
b2 = b1; \
\
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
\
- EdmaMgr_wait(edma_handle_c0); \
+ lib_emt_wait(emt_handle_c0); \
if(j < n_iter-1) /* no transfer for last iteration */ \
{ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1+cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1+cstep_c, \
cNew0, m*sizeof(ctype), \
n_next, cs_c*sizeof(ctype), \
cs_c11*sizeof(ctype)); \
if(i == 0) \
{ \
if(bli_intersects_diag_n( diagoffa_i, MR, k )) \
- idma1_setup(a2_L1, a1, (k - diagoffa_i)*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, (k - diagoffa_i)*MR*sizeof(ctype)); \
else \
- idma1_setup(a2_L1, a1, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, k*MR*sizeof(ctype)); \
} \
\
/* If the current panel of A intersects the diagonal, scale C
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + ps_a_cur; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
temp = a1_L1; \
a1_L1 = a2_L1; \
} \
else \
{ \
- idma1_setup(a2_L1, a2, k_next*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k_next*MR*sizeof(ctype)); \
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
temp = a1_L1; \
a1_L1 = a2_L1; \
b2 = b_cast; \
} \
else \
- idma1_setup(a2_L1, a2, k_next*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k_next*MR*sizeof(ctype)); \
\
/* Save addresses of next panels of A and B to the auxinfo_t
object. */ \
cNew1 = cNewTemp; \
if(j != 0) /* wait for save c to complete; skip first iteration */ \
{ \
- EdmaMgr_wait(edma_handle_c1); \
+ lib_emt_wait(emt_handle_c1); \
} \
/* save updated c*/ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew2, c1, m*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew2, c1, m*sizeof(ctype), \
n_cur, cs_c11*sizeof(ctype), cs_c*sizeof(ctype)); \
} \
else \
bli_mem_release( &a2_L1_mem ); \
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
- if ( edma_handle_c0 != NULL ) \
+ if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); /* wait for save c to complete */ \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); /* wait for save c to complete */ \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
/*PASTEMAC(ch,fprintm)( stdout, "trmm_lu_ker_var2: a1", MR, k_a1112, a1, 1, MR, "%4.1f", "" );*/ \
/*PASTEMAC(ch,fprintm)( stdout, "trmm_lu_ker_var2: b1", k_a1112, NR, b1_i, NR, 1, "%4.1f", "" );*/ \
index b00b37905e649d861ad59263ce7494762d3454f0..0486cc2974d9fd46ea44a0a13d6311989eb6d726 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp; \
\
/*EDMA Declarations */ \
- EdmaMgr_Handle edma_handle_b = NULL; \
- EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL; \
+ lib_emt_Handle emt_handle_b = NULL; \
+ lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL; \
\
/*
Assumptions/assertions:
cNew2 = bli_mem_buffer( &c2_L2_mem ); \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
\
n_cur = ( bli_is_not_edge_f( 0, n_iter, n_left ) ? NR : n_left ); \
/* Transfering MC(=m)xNR*/ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1, \
+ lib_emt_copy2D2D(emt_handle_c0, c1, \
cNew1, m*sizeof(ctype), \
n_cur, cs_c*sizeof(ctype), cs_c11*sizeof(ctype)); \
} \
/* Initialize our next panel of B to be the current panel of B. */ \
b2 = b1; \
\
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k_b1121*NR*sizeof(ctype)); \
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k_b1121*NR*sizeof(ctype)); \
\
- EdmaMgr_wait(edma_handle_c0); \
+ lib_emt_wait(emt_handle_c0); \
if(j < n_iter-1) /* no transfer for last iteration */ \
{ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1+cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1+cstep_c, \
cNew0, m*sizeof(ctype), \
n_next, cs_c*sizeof(ctype), \
cs_c11*sizeof(ctype)); \
\
if(i == 0) \
{ \
- idma1_setup(a2_L1, a1 + ( off_b1121 * PACKMR ) / off_scl, k_b1121*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1 + ( off_b1121 * PACKMR ) / off_scl, a2_L1, k_b1121*MR*sizeof(ctype)); \
} \
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
/*a1_i = a1_L1 + ( off_b1121 * PACKMR ) / off_scl;*/ \
a1_i = a1_L1; \
else \
{ \
/*Start next panel*/ \
- idma1_setup(a2_L1, a2 + ( off_b1121 * PACKMR ) / off_scl, k_b1121*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2 + ( off_b1121 * PACKMR ) / off_scl, a2_L1, k_b1121*MR*sizeof(ctype)); \
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
\
if(i == 0) \
{ \
- idma1_setup(a2_L1, a1, k_b1121*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, k_b1121*MR*sizeof(ctype)); \
} \
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
if ( bli_is_last_iter( i, m_iter, 0, 1 ) ) \
{ \
else \
{ \
/*Start next panel*/ \
- idma1_setup(a2_L1, a2, k_b1121*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k_b1121*MR*sizeof(ctype)); \
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
cNew1 = cNewTemp; \
if(j != 0) /* wait for save c to complete; skip first iteration */ \
{ \
- EdmaMgr_wait(edma_handle_c1); \
+ lib_emt_wait(emt_handle_c1); \
} \
/* save updated c*/ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew2, c1, m*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew2, c1, m*sizeof(ctype), \
n_cur, cs_c11*sizeof(ctype), cs_c*sizeof(ctype)); \
} \
else \
bli_mem_release( &a2_L1_mem ); \
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
- if ( edma_handle_c0 != NULL ) \
+ if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); /* wait for save c to complete */ \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); /* wait for save c to complete */ \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
/*PASTEMAC(ch,fprintm)( stdout, "trmm_rl_ker_var2: a1", MR, k_b1121, a1, 1, MR, "%4.1f", "" );*/ \
/*PASTEMAC(ch,fprintm)( stdout, "trmm_rl_ker_var2: b1", k_b1121, NR, b1_i, NR, 1, "%4.1f", "" );*/ \
index ee0a25cafd7661de90513e4c0cff2e90c092eb10..3731fecc21daf9ccecbe60c3de43ab5a7ec6844f 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp; \
\
/*EDMA Declarations */ \
- EdmaMgr_Handle edma_handle_b = NULL; \
- EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL; \
+ lib_emt_Handle emt_handle_b = NULL; \
+ lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL; \
\
/*
Assumptions/assertions:
cNew2 = bli_mem_buffer( &c2_L2_mem ); \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle CoreID %d \n", lib_get_coreID()); \
} \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
\
n_cur = ( bli_is_not_edge_f( 0, n_iter, n_left ) ? NR : n_left ); \
/* Transfering MC(=m)xNR*/ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1, \
+ lib_emt_copy2D2D(emt_handle_c0, c1, \
cNew1, m*sizeof(ctype), \
n_cur, cs_c*sizeof(ctype), cs_c11*sizeof(ctype)); \
} \
/* Initialize our next panel of B to be the current panel of B. */ \
b2 = b1; \
\
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k_b0111*NR*sizeof(ctype)); \
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k_b0111*NR*sizeof(ctype)); \
\
- EdmaMgr_wait(edma_handle_c0); \
+ lib_emt_wait(emt_handle_c0); \
if(j < n_iter-1) /* no transfer for last iteration */ \
{ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1+cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1+cstep_c, \
cNew0, m*sizeof(ctype), \
n_next, cs_c*sizeof(ctype), \
cs_c11*sizeof(ctype)); \
\
if(i == 0) \
{ \
- idma1_setup(a2_L1, a1 + ( off_b0111 * PACKMR ) / off_scl, k_b0111*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1 + ( off_b0111 * PACKMR ) / off_scl, a2_L1, k_b0111*MR*sizeof(ctype)); \
} \
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
\
/*a1_i = a1_L1 + ( off_b0111 * PACKMR ) / off_scl;*/ \
else \
{ \
/*Start next panel*/ \
- idma1_setup(a2_L1, a2 + ( off_b0111 * PACKMR ) / off_scl, k_b0111*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2 + ( off_b0111 * PACKMR ) / off_scl, a2_L1, k_b0111*MR*sizeof(ctype)); \
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
\
if(i == 0) \
{ \
- idma1_setup(a2_L1, a1, k_b0111*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, k_b0111*MR*sizeof(ctype)); \
} \
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
\
if ( bli_is_last_iter( i, m_iter, 0, 1 ) ) \
else \
{ \
/*Start next panel*/ \
- idma1_setup(a2_L1, a2, k_b0111*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k_b0111*MR*sizeof(ctype)); \
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
cNew1 = cNewTemp; \
if(j != 0) /* wait for save c to complete; skip first iteration */ \
{ \
- EdmaMgr_wait(edma_handle_c1); \
+ lib_emt_wait(emt_handle_c1); \
} \
/* save updated c*/ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew2, c1, m*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew2, c1, m*sizeof(ctype), \
n_cur, cs_c11*sizeof(ctype), cs_c*sizeof(ctype)); \
}\
else \
bli_mem_release( &a2_L1_mem ); \
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
- if ( edma_handle_c0 != NULL ) \
+ if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); /* wait for save c to complete */ \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); /* wait for save c to complete */ \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
/*PASTEMAC(ch,fprintm)( stdout, "trmm_ru_ker_var2: a1", MR, k_b0111, a1, 1, MR, "%4.1f", "" );*/ \
/*PASTEMAC(ch,fprintm)( stdout, "trmm_ru_ker_var2: b1", k_b0111, NR, b1_i, NR, 1, "%4.1f", "" );*/ \
index b0da52b18f8d1fdb4fd28168259daa851dacddea..f6145a2310a525540a773e4787e8b87eef238ba1 100644 (file)
// DMA control leaf unrolling for A
//printf("Init DMA A2 %x ", bli_mem_buffer(&(a1_dma->dma_mem)));
bli_dmam_init( &a1, a1_dma, cntl_sub_dmam_a( cntl ) );
- //printf("after DMA init %x %x %x\n", bli_mem_buffer(&(a1_dma->dma_mem)), bli_mem_buffer(&(a1_dma->pack_mem)), a1_dma->edma_handle);
+ //printf("after DMA init %x %x %x\n", bli_mem_buffer(&(a1_dma->dma_mem)), bli_mem_buffer(&(a1_dma->pack_mem)), a1_dma->emt_handle);
}
bli_dmam_int( &a1, a1_dma, cntl_sub_dmam_a( cntl ), (dmam_thrinfo_t *) trsm_thread_sub_ipackm( thread ) );
}
if( thread_am_ichief( thread ) ) {
bli_packm_init( a1_dma, a1_pack,
cntl_sub_packm_a( cntl ) );
- //printf("after Pack init %x %x %x\n", bli_mem_buffer(&(a1_pack->dma_mem)), bli_mem_buffer(&(a1_pack->pack_mem)), a1_pack->edma_handle);
+ //printf("after Pack init %x %x %x\n", bli_mem_buffer(&(a1_pack->dma_mem)), bli_mem_buffer(&(a1_pack->pack_mem)), a1_pack->emt_handle);
}
thread_ibarrier( thread );
// DMA control leaf unrolling for A
//printf("Init DMA A2 %x ", bli_mem_buffer(&(a1_dma->dma_mem)));
bli_dmam_init( &a1, a1_dma, cntl_sub_dmam_a( cntl ) );
- //printf("after DMA init %x %x %x\n", bli_mem_buffer(&(a1_dma->dma_mem)), bli_mem_buffer(&(a1_dma->pack_mem)), a1_dma->edma_handle);
+ //printf("after DMA init %x %x %x\n", bli_mem_buffer(&(a1_dma->dma_mem)), bli_mem_buffer(&(a1_dma->pack_mem)), a1_dma->emt_handle);
}
bli_dmam_int( &a1, a1_dma, cntl_sub_dmam_a( cntl ), (dmam_thrinfo_t *) trsm_thread_sub_ipackm( thread ) );
bli_obj_release_pack( b_pack , cntl_sub_packm_b(cntl));
if( thread_am_ichief( thread ) )
{
- //printf("before Pack release %x %x %x\n", bli_mem_buffer(&(a1_pack->dma_mem)), bli_mem_buffer(&(a1_pack->pack_mem)), a1_pack->edma_handle);
+ //printf("before Pack release %x %x %x\n", bli_mem_buffer(&(a1_pack->dma_mem)), bli_mem_buffer(&(a1_pack->pack_mem)), a1_pack->emt_handle);
bli_obj_release_pack( a1_pack, cntl_sub_packm_a(cntl) );
- //printf("after Pack release %x %x %x\n", bli_mem_buffer(&(a1_pack->dma_mem)), bli_mem_buffer(&(a1_pack->pack_mem)), a1_pack->edma_handle);
+ //printf("after Pack release %x %x %x\n", bli_mem_buffer(&(a1_pack->dma_mem)), bli_mem_buffer(&(a1_pack->pack_mem)), a1_pack->emt_handle);
#ifdef BLIS_ENABLE_C66X_EDMA
-// printf("before DMA release %x %x %x\n", bli_mem_buffer(&(a1_dma->dma_mem)), bli_mem_buffer(&(a1_dma->pack_mem)), a1_dma->edma_handle);
+// printf("before DMA release %x %x %x\n", bli_mem_buffer(&(a1_dma->dma_mem)), bli_mem_buffer(&(a1_dma->pack_mem)), a1_dma->emt_handle);
bli_obj_release_dma( a1_dma, cntl_sub_dmam_a(cntl) );
- bli_obj_release_edma_handle( a1_dma );
-// printf("after DMA release %x %x %x\n", bli_mem_buffer(&(a1_dma->dma_mem)), bli_mem_buffer(&(a1_dma->pack_mem)), a1_dma->edma_handle);
+ bli_obj_release_emt_handle( a1_dma );
+// printf("after DMA release %x %x %x\n", bli_mem_buffer(&(a1_dma->dma_mem)), bli_mem_buffer(&(a1_dma->pack_mem)), a1_dma->emt_handle);
#endif
}
index e7f46898c80353e08d2da3495bd6f9470d739067..35b8a8fba019972af08d07f03c41a745052184a8 100644 (file)
{
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma , cntl_sub_dmam_a(cntl));
- bli_obj_release_edma_handle( a1_dma );
+ bli_obj_release_emt_handle( a1_dma );
#endif
bli_obj_release_pack( a1_pack , cntl_sub_packm_a(cntl));
}
index f972059a3c48ed46bbca21dc357a0c9572bb1852..7d66387b89acb8dec0369c266a434478ca417ab6 100644 (file)
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma, cntl_sub_dmam_a(cntl) );
bli_obj_release_dma( b1_dma, cntl_sub_dmam_b(cntl) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( b1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( b1_dma );
#endif
bli_obj_release_pack( a1_pack, cntl_sub_packm_a(cntl) );
bli_obj_release_pack( b1_pack, cntl_sub_packm_b(cntl) );
index 60268aec06afb841e9cc219637d35bbfddd30f3f..8185c46a7903934d36a41a419298692b60f86efe 100644 (file)
#ifdef BLIS_ENABLE_C66X_EDMA
bli_obj_release_dma( a1_dma, cntl_sub_dmam_a(cntl) );
bli_obj_release_dma( b1_dma, cntl_sub_dmam_b(cntl) );
- bli_obj_release_edma_handle( a1_dma );
- bli_obj_release_edma_handle( b1_dma );
+ bli_obj_release_emt_handle( a1_dma );
+ bli_obj_release_emt_handle( b1_dma );
#endif
bli_obj_release_pack( a1_pack, cntl_sub_packm_a(cntl) );
bli_obj_release_pack( b1_pack, cntl_sub_packm_b(cntl) );
index ccb153fd74b1f2b3f7dcc20298774cf0655c7025..bea7aee266f8dd157bbafe013706594be19c3136 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp; \
/*EDMA Declarations */ \
\
- EdmaMgr_Handle edma_handle_b = NULL; \
- EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL; \
+ lib_emt_Handle emt_handle_b = NULL; \
+ lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL; \
\
/*
Assumptions/assertions:
cNew2 = bli_mem_buffer( &c2_L2_mem ); \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle CoreID %d \n", lib_get_coreID()); \
} \
- bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
\
/*for(jb = 0; jb < 16; jb ++) \
c1 = c1 + (n_iter-1)*cstep_c; \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1, \
+ lib_emt_copy2D2D(emt_handle_c0, c1, \
cNew1, m*sizeof(ctype), \
n_cur, cs_c*sizeof(ctype), cs_c11*sizeof(ctype)); \
} \
}\
}\
/*else \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1 = c1 + (n_iter-1)*cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1 = c1 + (n_iter-1)*cstep_c, \
cNew1, n_cur*sizeof(ctype), \
m, rs_c*sizeof(ctype), rs_c11*sizeof(ctype));*/ \
\
n_cur = ( bli_is_not_edge_b( jb, n_iter, n_left ) ? NR : n_left ); \
n_next = ( bli_is_not_edge_b( jb+1, n_iter, n_left ) ? NR : n_left ); \
\
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
/* Initialize our next panel of B to be the current panel of B. */ \
b2 = b1; \
if(rs_c == 1) \
- EdmaMgr_wait(edma_handle_c0); \
+ lib_emt_wait(emt_handle_c0); \
if(jb < n_iter-1) /* no transfer for last iteration */ \
{ \
if (rs_c == 1) \
{ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1-cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1-cstep_c, \
cNew0, m*sizeof(ctype), \
n_next, cs_c*sizeof(ctype), \
cs_c11*sizeof(ctype)); \
}\
/*else \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c0, c1 - cstep_c, \
+ lib_emt_copy2D2D(emt_handle_c0, c1 - cstep_c, \
cNew0, n_next*sizeof(ctype), \
m, rs_c*sizeof(ctype), rs_c11*sizeof(ctype)); \
}*/ \
/*printf("%d %d %d %d \n", k, MR, off_b11, PACKMR);*/ \
if (i == 0) \
{ \
- idma1_setup(a2_L1, a1 + ( off_b11 * PACKMR ) / off_scl, k_b1121*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1 + ( off_b11 * PACKMR ) / off_scl, a2_L1, k_b1121*MR*sizeof(ctype)); \
} \
\
/*ORIG TRSM*/ \
\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
/*if ( i + thread_num_threads(thread) >= m_iter )*/ \
if ( bli_is_last_iter( i, m_iter, 0, 1 ) ) \
else \
{ \
/*Start next panel*/ \
- idma1_setup(a2_L1, a2 + ( off_b11 * PACKMR ) / off_scl , k_b1121*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2 + ( off_b11 * PACKMR ) / off_scl, a2_L1, k_b1121*MR*sizeof(ctype)); \
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
ct, rs_ct, cs_ct, \
c11, rs_c11, cs_c11 /* rs_c, cs_c **** 1, cstep_c11*/); \
} \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
/*printf("%d %d \n", k_b11, PACKMR);*/ \
- idma1_setup(a1 + ( off_b11 * PACKMR ) / off_scl, a11, k_b11*PACKMR*sizeof(ctype), 0,0,7); \
+ lib_imt_copy(a11, a1 + ( off_b11 * PACKMR ) / off_scl, k_b11*PACKMR*sizeof(ctype)); \
} \
\
a1 += rstep_a; \
\
if(i == 0) \
{ \
- idma1_setup(a2_L1, a1, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, k*MR*sizeof(ctype)); \
} \
\
/*ORIG TRSM*/ \
/*a2 = a1;*/\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
}\
/*if ( bli_is_last_iter( i, m_iter, 0, 1 ) ) */\
if ( i + thread_num_threads(thread) >= m_iter ) \
else \
{ \
/*Start next panel*/ \
- idma1_setup(a2_L1, a2 , k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k*MR*sizeof(ctype)); \
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
cNew1 = cNewTemp; \
if(j != 0) /* wait for save c to complete; skip first iteration */ \
{ \
- EdmaMgr_wait(edma_handle_c1); \
+ lib_emt_wait(emt_handle_c1); \
} \
} \
/* save updated c*/ \
{ \
if (cs_c*sizeof(ctype) < BLIS_C66X_MAXDMASTRIDE) \
{ \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew2, c1, m*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew2, c1, m*sizeof(ctype), \
n_cur, cs_c11*sizeof(ctype), cs_c*sizeof(ctype)); \
}\
else \
} \
} \
/*else \
- EdmaMgr_copy2D2DSep(edma_handle_c1, cNew1, c1, n_cur*sizeof(ctype), \
+ lib_emt_copy2D2D(emt_handle_c1, cNew1, c1, n_cur*sizeof(ctype), \
m, rs_c11*sizeof(ctype), rs_c*sizeof(ctype)); */\
\
c1 -= cstep_c; \
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
}\
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
- if ( edma_handle_c0 != NULL ) \
+ if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); /* wait for save c to complete */ \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); /* wait for save c to complete */ \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
}
index 0d8caf5236b73dda5ad2b8fc54db53fdcb307d22..f126f6ab63f434c6d7164ef29f79e06ed9f15347 100644 (file)
ctype *cNew0, *cNew1, *cNew2, *cNewTemp;*/ \
/*EDMA Declarations */ \
\
- EdmaMgr_Handle edma_handle_b = NULL; \
-/* EdmaMgr_Handle edma_handle_c0 = NULL; \
- EdmaMgr_Handle edma_handle_c1 = NULL;*/ \
+ lib_emt_Handle emt_handle_b = NULL; \
+/* lib_emt_Handle emt_handle_c0 = NULL; \
+ lib_emt_Handle emt_handle_c1 = NULL;*/ \
\
/*
Assumptions/assertions:
*/ \
\
/*Acquiring an EDMA handle from the pool*/ \
- bli_dma_channel_acquire(&(edma_handle_b), CSL_chipReadDNUM()); \
- if(edma_handle_b == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_b), lib_get_coreID()); \
+ if(emt_handle_b == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle CoreID %d \n", lib_get_coreID()); \
} \
-/* bli_dma_channel_acquire(&(edma_handle_c0), CSL_chipReadDNUM()); \
- if(edma_handle_c0 == NULL) \
+/* bli_dma_channel_acquire(&(emt_handle_c0), lib_get_coreID()); \
+ if(emt_handle_c0 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C0 CoreID %d \n", lib_get_coreID()); \
} \
- bli_dma_channel_acquire(&(edma_handle_c1), CSL_chipReadDNUM()); \
- if(edma_handle_c1 == NULL) \
+ bli_dma_channel_acquire(&(emt_handle_c1), lib_get_coreID()); \
+ if(emt_handle_c1 == NULL) \
{ \
- printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", CSL_chipReadDNUM()); \
+ printf("ker_var2 Failed to alloc edma handle for C1 CoreID %d \n", lib_get_coreID()); \
} \
*/ \
\
\
n_cur = ( bli_is_not_edge_f( j, n_iter, n_left ) ? NR : n_left ); \
\
- EdmaMgr_copy1D1D(edma_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
+ lib_emt_copy1D1D(emt_handle_b, b1, b1_L1, k*NR*sizeof(ctype)); \
/* Initialize our next panel of B to be the current panel of B. */ \
b2 = b1; \
\
\
if (i == 0) \
{ \
- idma1_setup(a2_L1, a1, k_b0111*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, k_b0111*MR*sizeof(ctype)); \
} \
\
/* Compute the addresses of the next panels of A and B. */ \
/*a2 = a1;*/ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
/*if ( bli_is_last_iter( i, m_iter, 0, 1 ) ) */\
if ( i + thread_num_threads(thread) >= m_iter ) \
else \
{ \
/*Start next panel*/ \
- idma1_setup(a2_L1, a2, k_b0111*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k_b0111*MR*sizeof(ctype)); \
} \
\
/* Compute the addresses of the A10 panel and A11 block. */ \
ct, rs_ct, cs_ct, \
c11, rs_c, cs_c ); \
} \
- while(!idma1_done()){;} \
- idma1_setup(a1 + ( off_b11 * PACKMR ) / off_scl, a11, NR*PACKMR*sizeof(ctype), 0,0,7); \
+ lib_imt_wait(); \
+ lib_imt_copy(a11, a1 + ( off_b11 * PACKMR ) / off_scl, NR*PACKMR*sizeof(ctype)); \
} \
\
a1 += rstep_a; \
\
if(i == 0) \
{ \
- idma1_setup(a2_L1, a1, k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a1, a2_L1, k*MR*sizeof(ctype)); \
} \
/*ORIG TRSM*/ \
/* Compute the addresses of the next panels of A and B. */ \
/*a2 = a1;*/\
/* Compute the addresses of the next panels of A and B. */ \
a2 = a1 + rstep_a; \
- while(!idma1_done()){;} \
+ lib_imt_wait(); \
temp = a1_L1; \
a1_L1 = a2_L1; \
a2_L1 = temp; \
if(i == 0) \
{ \
- EdmaMgr_wait(edma_handle_b);\
+ lib_emt_wait(emt_handle_b);\
} \
/*if ( bli_is_last_iter( i, m_iter, 0, 1 ) ) */\
if ( i + thread_num_threads(thread) >= m_iter ) \
else \
{ \
/*Start next panel*/ \
- idma1_setup(a2_L1, a2 , k*MR*sizeof(ctype), 0, 0, 7); \
+ lib_imt_copy(a2, a2_L1, k*MR*sizeof(ctype)); \
} \
\
/* Save addresses of next panels of A and B to the auxinfo_t
bli_mem_release( &a1_L1_mem ); \
bli_mem_release( &b1_L1_mem ); \
}\
- if ( edma_handle_b != NULL ) \
+ if ( emt_handle_b != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_b, CSL_chipReadDNUM()); \
- edma_handle_b = NULL; \
+ bli_dma_channel_release(emt_handle_b, lib_get_coreID()); \
+ emt_handle_b = NULL; \
} \
-/* if ( edma_handle_c0 != NULL ) \
+/* if ( emt_handle_c0 != NULL ) \
{ \
- bli_dma_channel_release(edma_handle_c0, CSL_chipReadDNUM()); \
- edma_handle_c0 = NULL; \
+ bli_dma_channel_release(emt_handle_c0, lib_get_coreID()); \
+ emt_handle_c0 = NULL; \
} \
- if ( edma_handle_c1 != NULL ) \
+ if ( emt_handle_c1 != NULL ) \
{ \
- EdmaMgr_wait(edma_handle_c1); \
- bli_dma_channel_release(edma_handle_c1, CSL_chipReadDNUM()); \
- edma_handle_c1 = NULL; \
+ lib_emt_wait(emt_handle_c1); \
+ bli_dma_channel_release(emt_handle_c1, lib_get_coreID()); \
+ emt_handle_c1 = NULL; \
} \
*/ \
}
index 80bf770d10d31a04f790af06bd5bff196bbd0797..faf1e3b3d2ecd87fb69d17dfb0808a759e37e858 100755 (executable)
//#define BLIS_ENABLE_CYCLE_COUNT
static dma_t dma_pools[BLIS_MAX_NUM_THREADS]; // One pool for each core.
-static EdmaMgr_Handle pool_coreX_edma_handles[BLIS_MAX_NUM_THREADS][BLIS_C66X_EDMA_MAX_NUM_CHANNELS];
+static lib_emt_Handle pool_coreX_emt_handles[BLIS_MAX_NUM_THREADS][BLIS_C66X_EDMA_MAX_NUM_CHANNELS];
//for initilization during encoding the dma control leaf
dmam_t* bli_dmam_cntl_obj_create( impl_t impl_type,
_Pragma( "omp parallel num_threads(BLIS_MAX_NUM_THREADS)" )
{
gint_t status; //int32_t
+/*
#ifdef BLIS_ENABLE_C66X_OPENCL
- status = EdmaMgr_SUCCESS;
+ status = LIB_EMT_SUCCESS;
#else
- status = EdmaMgr_init(CSL_chipReadDNUM(), NULL);
+ status = EdmaMgr_init(lib_get_coreID(), NULL);
#endif
- if(status != EdmaMgr_SUCCESS)
+*/
+ status = lib_emt_init();
+
+ if(status != LIB_EMT_SUCCESS)
{
- printf("Core %d DMA not initialized\n", CSL_chipReadDNUM());
+ printf("Core %d DMA not initialized\n", lib_get_coreID());
exit(1);
}
- bli_dma_init_pool(status, BLIS_C66X_EDMA_MAX_NUM_CHANNELS, pool_coreX_edma_handles[CSL_chipReadDNUM()], &dma_pools[CSL_chipReadDNUM()]);
+ bli_dma_init_pool(status, BLIS_C66X_EDMA_MAX_NUM_CHANNELS, pool_coreX_emt_handles[lib_get_coreID()], &dma_pools[lib_get_coreID()]);
}
}
-void bli_dma_init_pool(gint_t edma_status,
+void bli_dma_init_pool(gint_t emt_status,
gint_t num_channels,
- EdmaMgr_Handle* pool_edma_handles,
+ lib_emt_Handle* pool_emt_handles,
dma_t* dma_pool)
{
dim_t i;
- EdmaMgr_Handle temp_handle;
- if(edma_status != EdmaMgr_SUCCESS)
+ lib_emt_Handle temp_handle;
+ if(emt_status != LIB_EMT_SUCCESS)
{
- dma_pool->edma_status = FALSE;
- printf("Core %d DMA not initialized\n", CSL_chipReadDNUM());
+ dma_pool->emt_status = FALSE;
+ printf("Core %d DMA not initialized\n", lib_get_coreID());
return;
}
- dma_pool->edma_status = TRUE;
+ dma_pool->emt_status = TRUE;
for(i = 0; i < num_channels; i++)
{
- //pool_edma_handles[i] = EdmaMgr_alloc(1);
- temp_handle = EdmaMgr_alloc(1);
+ //pool_emt_handles[i] = lib_emt_alloc(1);
+ temp_handle = lib_emt_alloc(1);
if(temp_handle == NULL)
{
- printf("Failed to alloc edma handle CoreID %d\n", CSL_chipReadDNUM());
+ printf("Failed to alloc edma handle CoreID %d\n", lib_get_coreID());
return;
}
- pool_edma_handles[i] = temp_handle;
+ pool_emt_handles[i] = temp_handle;
}
dma_pool->num_channels = num_channels;
- dma_pool->edma_handle = pool_edma_handles;
+ dma_pool->emt_handle = pool_emt_handles;
dma_pool->top_index = num_channels-1;
#ifdef BLIS_EDMA_DEBUG
- printf("Core ID %d, Dma pool top index %d, num channels = %d\n",CSL_chipReadDNUM(), dma_pool->top_index, dma_pool->num_channels);
+ printf("Core ID %d, Dma pool top index %d, num channels = %d\n",lib_get_coreID(), dma_pool->top_index, dma_pool->num_channels);
#endif
}
-void bli_dma_channel_acquire(EdmaMgr_Handle* edma_handle, dim_t core_id)
+void bli_dma_channel_acquire(lib_emt_Handle* emt_handle, dim_t core_id)
{
dma_t* dma_pool;
- EdmaMgr_Handle* edma_handle_ptrs;
+ lib_emt_Handle* emt_handle_ptrs;
dim_t i;
dma_pool = &dma_pools[core_id];
}
// Get all the handles of DMA pool
- edma_handle_ptrs = dma_pool->edma_handle;
+ emt_handle_ptrs = dma_pool->emt_handle;
//Get index of the top most available handle
i = dma_pool->top_index;
//Get edma handle
- *edma_handle = edma_handle_ptrs[i];
+ *emt_handle = emt_handle_ptrs[i];
#ifdef BLIS_EDMA_DEBUG
- printf("Acquiring DMA handle, top index %d edma handle %x %x\n", i, *edma_handle, edma_handle_ptrs[i]);
+ printf("Acquiring DMA handle, top index %d edma handle %x %x\n", i, *emt_handle, emt_handle_ptrs[i]);
#endif
// Decrement the index so that it now points to the next available handle.
dma_pool->top_index--;
}
-void bli_dma_channel_release(EdmaMgr_Handle edma_handle, dim_t core_id)
+void bli_dma_channel_release(lib_emt_Handle emt_handle, dim_t core_id)
{
dma_t* dma_pool;
- EdmaMgr_Handle* edma_handle_ptrs;
+ lib_emt_Handle* emt_handle_ptrs;
dim_t i;
- if(edma_handle == NULL)
+ if(emt_handle == NULL)
{
printf("nothing to release\n");
return;
dma_pool = &dma_pools[core_id];
// Get all the handles of DMA pool
- edma_handle_ptrs = dma_pool->edma_handle;
+ emt_handle_ptrs = dma_pool->emt_handle;
// Increment the index so that it now points to the next available handle.
dma_pool->top_index++;
//Place the edma handle back onto the top of the dma pool.
// This is done so that if handles were release not in the same order
// that they were acquired, the next time a handle is acquired it gets the latest released one.
- edma_handle_ptrs[i] = edma_handle;
+ emt_handle_ptrs[i] = emt_handle;
#ifdef BLIS_EDMA_DEBUG
- printf("Released DMA handle, top index %d edma handle %x \n", i, edma_handle_ptrs[i]);
+ printf("Released DMA handle, top index %d edma handle %x \n", i, emt_handle_ptrs[i]);
#endif
}
bli_obj_set_buffer( buf, *p );
//If definition does not have an EDMA channel, then acquire a channel from the pool
- if(p->edma_handle == NULL)
+ if(p->emt_handle == NULL)
{
- bli_dma_channel_acquire(&(p->edma_handle), CSL_chipReadDNUM());
- if(p->edma_handle == NULL)
- printf("DMAM_INIT Failed to alloc edma handle CoreID %d %x\n", CSL_chipReadDNUM(), p->edma_handle);
+ bli_dma_channel_acquire(&(p->emt_handle), lib_get_coreID());
+ if(p->emt_handle == NULL)
+ printf("DMAM_INIT Failed to alloc edma handle CoreID %d %x\n", lib_get_coreID(), p->emt_handle);
}
}
if(thread->work_id == 0)
{
// ld_source is already in terms of bytes
- if(ld_source < BLIS_C66X_MAXDMASTRIDE && p->edma_handle != NULL)
+ if(ld_source < BLIS_C66X_MAXDMASTRIDE && p->emt_handle != NULL)
{
int status = -100;
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_start = TSCL;
#endif
// The destination object contains the EDMA handle
- status = EdmaMgr_copy2D2DSep ( p->edma_handle,
+ status = lib_emt_copy2D2D ( p->emt_handle,
ptr_source,
ptr_dest,
elem_move,
#endif
- if(status != EdmaMgr_SUCCESS)
+ if(status != LIB_EMT_SUCCESS)
printf("DMA Transfer Error %d \n",status);
}
else // cannot use DMA since stride is only 16 bit signed
// Wait only if current thread work ID is zero
if(thread->work_id == 0)
{
- EdmaMgr_wait(p->edma_handle);
+ lib_emt_wait(p->emt_handle);
}
}
-void bli_obj_release_edma_handle( obj_t* p)
+void bli_obj_release_emt_handle( obj_t* p)
{
- if ( p->edma_handle != NULL )
+ if ( p->emt_handle != NULL )
{
- bli_dma_channel_release(p->edma_handle, CSL_chipReadDNUM());
- p->edma_handle = NULL;
+ bli_dma_channel_release(p->emt_handle, lib_get_coreID());
+ p->emt_handle = NULL;
}
}
{
dim_t i;
dma_t* dma_pool;
- EdmaMgr_Handle* edma_handle;
+ lib_emt_Handle* emt_handle;
//Create omp threads
- dma_pool = &dma_pools[CSL_chipReadDNUM()];
- edma_handle = dma_pool->edma_handle;
+ dma_pool = &dma_pools[lib_get_coreID()];
+ emt_handle = dma_pool->emt_handle;
for(i = 0; i < BLIS_C66X_EDMA_MAX_NUM_CHANNELS; i ++)
{
- if( edma_handle[i] != NULL)
+ if( emt_handle[i] != NULL)
{
- if(EdmaMgr_free( edma_handle[i] ) == EdmaMgr_ERROR_FREE)
+ if(lib_emt_free( emt_handle[i] ) == LIB_EMT_ERROR_FREE)
{
- printf("ERROR: edma_free\n");
+ printf("ERROR: emt_free\n");
}
else
- edma_handle[i] = NULL;
+ emt_handle[i] = NULL;
}
}
}
index 425879754d9f3022b3824da5b15907baa38d6088..d4b26f7e47b0640d9db39dca89008d58625468b4 100644 (file)
*/
struct dma_s
{
- bool_t edma_status;
- void** edma_handle;
+ bool_t emt_status;
+ void** emt_handle;
dim_t num_channels;
dim_t top_index;
};
\
( &((obj).dma_mem) )
-#define bli_obj_edma_handle( obj ) \
+#define bli_obj_emt_handle( obj ) \
\
- ( &((obj).edma_handle) )
+ ( &((obj).emt_handle) )
-#define bli_edma_handle_set_NULL(obj) \
+#define bli_emt_handle_set_NULL(obj) \
{ \
- (obj).edma_handle = NULL; \
+ (obj).emt_handle = NULL; \
}
#define bli_obj_alias_with_dma(a, b) \
{ \
bli_obj_alias_to( a, b ); \
- &((b).edma_handle) = &((a).edma_handle); \
+ &((b).emt_handle) = &((a).emt_handle); \
}
#define bli_obj_init_dma( obj_p ) \
\
bli_mem_set_buffer( NULL, pack_mem ); \
bli_mem_set_buffer( NULL, dma_mem ); \
- bli_edma_handle_set_NULL( *obj_p ); \
+ bli_emt_handle_set_NULL( *obj_p ); \
}
//#define bli_obj_init_dma( obj_p ) \
//{ \
// Functions to initialize the EDMA and EDMA channels
void bli_dma_init (void);
-void bli_dma_init_pool(gint_t edma_status,
+void bli_dma_init_pool(gint_t emt_status,
gint_t num_channels,
- EdmaMgr_Handle* pool_edma_handles,
+ lib_emt_Handle* pool_emt_handles,
dma_t * dma_pool);
-void bli_dma_channel_acquire(EdmaMgr_Handle* edma_handle, dim_t core_id);
-void bli_dma_channel_release(EdmaMgr_Handle edma_handle, dim_t core_id);
+void bli_dma_channel_acquire(lib_emt_Handle* emt_handle, dim_t core_id);
+void bli_dma_channel_release(lib_emt_Handle emt_handle, dim_t core_id);
void bli_dmam_wait(obj_t* p, dmam_t* cntl, dmam_thrinfo_t* thread);
-void bli_obj_release_edma_handle(obj_t* p);
+void bli_obj_release_emt_handle(obj_t* p);
void bli_dma_finalize(void);
index 4c3716248964432f606eea848e87ffa16f63df97..fc8bfe27ba88d41ee37d54b877b1047f1dddcdac 100644 (file)
if (bli_buf_type_is_shared(buf_type))
core_id = 0;
else
- core_id = CSL_chipReadDNUM ();
+ core_id = lib_get_coreID ();
#endif
if (bli_buf_type_is_shared(buf_type))
core_id = 0;
else
- core_id = CSL_chipReadDNUM ();
+ core_id = lib_get_coreID ();
#endif
if ( buf_type == BLIS_BUFFER_FOR_GEN_USE )
index da2dc4726582d1553e30b1f81865402d1e32e89e..24ebbf187fb6ce1a5fd2935fd90a10baf70375b2 100644 (file)
-#include "bli_config.h"
-#include "bli_system.h"
-#include "bli_type_defs.h"
-#include "bli_cblas.h"
#ifdef BLIS_ENABLE_CBLAS
/*
* cblas_caxpy.c
index 5a9a3dd1d20ae50aed6b073604323378eeb962c9..8afee1552d2e07d7cb71a6aa91c63741535ae7d1 100644 (file)
-#include "bli_config.h"
-#include "bli_system.h"
-#include "bli_type_defs.h"
-#include "bli_cblas.h"
#ifdef BLIS_ENABLE_CBLAS
/*
* cblas_ccopy.c
index b52c8bb975f14834d6f984b685f06247bf536c4a..2b01a4d62f286c2f6a817514a1f9f42f4fbb9ddd 100644 (file)
\
bli_mem_set_buffer( NULL, pack_mem ); \
bli_mem_set_buffer( NULL, dma_mem ); \
- bli_edma_handle_set_NULL( *obj_p ); \
+ bli_emt_handle_set_NULL( *obj_p ); \
}
#else
index 6a6f8d4f7fae4fbd590de1acaf1072f4d2d29d77..c597d3f2386bab722a1c27988870376e5ce81545 100644 (file)
#ifndef BLIS_TYPE_DEFS_H
#define BLIS_TYPE_DEFS_H
+//#include <ti/libarch/libarch.h>
//
// -- BLIS basic types ---------------------------------------------------------
#ifdef BLIS_ENABLE_C66X_EDMA
mem_t dma_mem;
- EdmaMgr_Handle edma_handle;
+ lib_emt_Handle emt_handle;
#endif
} obj_t;
(b).n_panel = (a).n_panel; \
(b).dma_mem = (a).dma_mem; \
/* Cannot use the macro because the definition of the bli_dma.h comes after bli_type_defs.h in blis.h */ \
- (b).edma_handle = NULL; \
+ (b).emt_handle = NULL; \
}
#else
#define bli_obj_init_full_shallow_copy_of( a, b ) \
index 6349347b1c8795a9ac0f69dd3a3e8f31ea8464b8..c1e82594cab1f30502a95633bed5b21fb046f6f9 100755 (executable)
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\t%d\t",k, counter_end-counter_start);
#endif
}
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\n", counter_end-counter_start);
#endif
}
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\t%d\t",k, counter_end-counter_start);
#endif
}
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\n", counter_end-counter_start);
#endif
}
}
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\t%d\t",k, counter_end-counter_start);
#endif
#ifdef BLIS_ENABLE_CYCLE_COUNT
*cptr += sum33 * al;
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\n", counter_end-counter_start);
#endif
return;
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\t%d\t",k, counter_end-counter_start);
#endif
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\n", counter_end-counter_start);
#endif
return;
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\t%d\t",k, counter_end-counter_start);
#endif
}
#ifdef BLIS_ENABLE_CYCLE_COUNT
counter_end=TSCL;
- if (CSL_chipReadDNUM () == 0)
+ if (lib_get_coreID () == 0)
printf("%d\n", counter_end-counter_start);
#endif