Skip to content

Commit

Permalink
Merge branch 'CLOC-0.9' of https://github.com/HSAFoundation/CLOC into…
Browse files Browse the repository at this point in the history
… CLOC-0.9-ReleaseCandidate
  • Loading branch information
shreyas committed May 11, 2015
2 parents f9e77e7 + e941b2b commit 2b38b3d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/snack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,15 @@ else
if [ $DRYRUN ] ; then
echo "hexdump -v -e '""0x"" 1/1 ""%02X"" "",""' $BRIGDIR/$BRIGNAME "
else
echo "char HSA_BrigMem[] = {" > $FULLBRIGHFILE
echo "char ${SYMBOLNAME}_HSA_BrigMem[] = {" > $FULLBRIGHFILE
hexdump -v -e '"0x" 1/1 "%02X" ","' $BRIGDIR/$BRIGNAME >> $FULLBRIGHFILE
rc=$?
if [ $rc != 0 ] ; then
echo "ERROR: The hexdump command failed with return code $rc."
exit $rc
fi
echo "};" >> $FULLBRIGHFILE
echo "size_t HSA_BrigMemSz = sizeof(HSA_BrigMem);" >> $FULLBRIGHFILE
echo "size_t ${SYMBOLNAME}_HSA_BrigMemSz = sizeof(${SYMBOLNAME}_HSA_BrigMem);" >> $FULLBRIGHFILE
fi


Expand Down
23 changes: 21 additions & 2 deletions bin/snk_genw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static hsa_status_t get_kernarg_memory_region(hsa_region_t region, void* data) {
/* Stream specific globals */
hsa_queue_t* Stream_CommandQ[SNK_MAX_STREAMS];
snk_task_t SNK_Tasks[SNK_MAX_TASKS];
int SNK_NextTaskId = 0 ;
static int SNK_NextTaskId = 0 ;
/* Context(cl file) specific globals */
hsa_ext_module_t* _CN__BrigModule;
Expand Down Expand Up @@ -370,7 +370,7 @@ status_t _CN__InitContext(){
/* printf("The maximum queue size is %u.\n", (unsigned int) queue_size); */
/* Load the BRIG binary. */
_CN__BrigModule = (hsa_ext_module_t*) &HSA_BrigMem;
_CN__BrigModule = (hsa_ext_module_t*) &_CN__HSA_BrigMem;
/* Create hsa program. */
memset(&_CN__HsaProgram,0,sizeof(hsa_ext_program_t));
Expand Down Expand Up @@ -452,6 +452,7 @@ function write_KernelStatics_template(){
hsa_executable_symbol_t _KN__Symbol;
int _KN__FK = 0 ;
status_t _KN__init();
status_t _KN__stop();
uint64_t _KN__Kernel_Object;
uint32_t _KN__Kernarg_Segment_Size; /* May not need to be global */
uint32_t _KN__Group_Segment_Size;
Expand Down Expand Up @@ -492,6 +493,24 @@ extern status_t _KN__init(){
} /* end of _KN__init */
extern status_t _KN__stop(){
status_t err;
if (_CN__FC == 0 ) {
/* weird, but we cannot stop unless we initialized the context */
err = _CN__InitContext();
if ( err != STATUS_SUCCESS ) return err;
_CN__FC = 1;
}
if ( _KN__FK == 1 ) {
/* Currently nothing kernel specific must be recovered */
_KN__FK = 0;
}
return STATUS_SUCCESS;
} /* end of _KN__stop */
EOF
}

Expand Down

0 comments on commit 2b38b3d

Please sign in to comment.