summaryrefslogtreecommitdiff
path: root/src/cuda-sim/cuda-sim.cc
diff options
context:
space:
mode:
authorsspenst <[email protected]>2016-08-04 13:09:41 -0700
committersspenst <[email protected]>2016-08-04 13:09:41 -0700
commitfeda07a5e0053ef2f2bfa382f5ba9a7a0b6c6bf5 (patch)
tree22be33d4b51a6d04dd32aac7ea8b199f213e0f17 /src/cuda-sim/cuda-sim.cc
parente08fc0294fe919a198477b771a414c5102430188 (diff)
A thread executing BSMAD is now able to access information from all threads in its warp
Diffstat (limited to 'src/cuda-sim/cuda-sim.cc')
-rw-r--r--src/cuda-sim/cuda-sim.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index e194a2a..059fbe2 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -849,8 +849,10 @@ void ptx_instruction::pre_decode()
switch ( get_opcode() ) {
#define OP_DEF(OP,FUNC,STR,DST,CLASSIFICATION) case OP: has_dst = (DST!=0); break;
+#define OP_W_DEF(OP,FUNC,STR,DST,CLASSIFICATION) case OP: has_dst = (DST!=0); break;
#include "opcodes.def"
#undef OP_DEF
+#undef OP_W_DEF
default:
printf( "Execution error: Invalid opcode (0x%x)\n", get_opcode() );
break;
@@ -1242,10 +1244,22 @@ void ptx_thread_info::ptx_exec_inst( warp_inst_t &inst, unsigned lane_id)
*((warp_inst_t*)pJ) = inst; // copy active mask information
pI = pJ;
}
+ /*const ptx_instruction **pA;
+ if( pI->get_opcode() == BSMAD_OP ) {
+ //pA = (const ptx_instruction**)malloc(get_core()->get_warp_size()*(sizeof(ptx_instruction*)));
+ pA = (const ptx_instruction**)malloc(8*(sizeof(ptx_instruction*)));
+ for (int i = 0; i < get_core()->get_warp_size() && inst.active(i); i++) {
+ //pA[i] = get_core()->get_thread_info()[inst.warp_id() * get_core()->get_warp_size() + i]->func_info()->get_instruction(pc+(i-lane_id)*(pI->inst_size()));
+ int tid = inst.warp_id() * get_core()->get_warp_size() + i;
+ pA[i] = get_core()->get_thread_info()[tid]->func_info()->get_instruction(pc);
+ }
+ }*/
switch ( pI->get_opcode() ) {
#define OP_DEF(OP,FUNC,STR,DST,CLASSIFICATION) case OP: FUNC(pI,this); op_classification = CLASSIFICATION; break;
+#define OP_W_DEF(OP,FUNC,STR,DST,CLASSIFICATION) case OP: FUNC(pI,get_core(),inst); op_classification = CLASSIFICATION; break;
#include "opcodes.def"
#undef OP_DEF
+#undef OP_W_DEF
default: printf( "Execution error: Invalid opcode (0x%x)\n", pI->get_opcode() ); break;
}
delete pJ;