Changeset 459 for trunk/user/sort
- Timestamp:
- Aug 13, 2018, 1:43:20 PM (6 years ago)
- Location:
- trunk/user/sort
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/user/sort/Makefile
r445 r459 1 1 ############################################################################ 2 # Makefile for the ALMOS-MKH "sort" application2 # Makefile for the "sort" application running on ALMOS-MKH 3 3 ############################################################################ 4 4 … … 15 15 -I$(LIBPTHREAD_INCLUDE) \ 16 16 -I$(LIBALMOSMKH_INCLUDE) \ 17 -I$(SHARED_INCLUDE) 17 -I$(SHARED_INCLUDE) \ 18 -I$(HAL_INCLUDE) 18 19 19 20 compile: dirs build/sort.elf 20 21 21 22 build/sort.elf : $(OBJS) sort.ld 22 $(LD) -o $@ -T sort.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmosmkh -lpthread -lc 23 $(LD) -o $@ -T sort.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) \ 24 -lc -lpthread -lalmosmkh -lpthread -lc 23 25 $(DU) -D $@ > $@.txt 24 26 -
trunk/user/sort/sort.c
r457 r459 26 26 #include <pthread.h> 27 27 #include <almosmkh.h> 28 #include <hal_macros.h> 28 29 29 30 #define ARRAY_LENGTH 0x400 // 1024 values … … 33 34 #define DISPLAY_ARRAY 0 34 35 #define INTERACTIVE_MODE 0 35 36 ///////////////////////////////////////////////////////37 // macros for fixed format cxy <=> (x,y) translation38 // TODO these macros are only for TSAR architecture...39 ///////////////////////////////////////////////////////40 41 #define CXY_FROM_XY( x , y ) ((x<<4) + y)42 43 #define X_FROM_CXY( cxy ) ((cxy>>4) & 0xF)44 45 #define Y_FROM_CXY( cxy ) (cxy & 0xF)46 36 47 37 ///////////////////////////////////////////////////////////// … … 239 229 // get core coordinates and user index for the main thread 240 230 get_core( &main_cxy , & main_lid ); 241 main_x = X_FROM_CXY( main_cxy );242 main_y = Y_FROM_CXY( main_cxy );231 main_x = HAL_X_FROM_CXY( main_cxy ); 232 main_y = HAL_Y_FROM_CXY( main_cxy ); 243 233 main_uid = (((main_x * y_size) + main_y) * ncores) + main_lid; 244 234 … … 308 298 // set thread attributes for all threads 309 299 attr[thread_uid].attributes = PT_ATTR_CLUSTER_DEFINED | PT_ATTR_CORE_DEFINED; 310 attr[thread_uid].cxy = CXY_FROM_XY( x , y );300 attr[thread_uid].cxy = HAL_CXY_FROM_XY( x , y ); 311 301 attr[thread_uid].lid = lid; 312 302
Note: See TracChangeset
for help on using the changeset viewer.