Skip to content

Commit

Permalink
mmio
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongminpark417 committed Mar 31, 2024
1 parent 5db3122 commit d20ef4a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/nvm_parallel_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ uint16_t sq_enqueue(nvm_queue_t* sq, nvm_cmd_t* cmd, simt::atomic<uint64_t, simt
if (pc_tail) {
*cur_pc_tail = pc_tail->load(simt::memory_order_acquire);
}
*(sq->db) = new_db;
// *(sq->db) = new_db;
asm volatile ("st.mmio.relaxed.sys.global.u32 [%0], %1;" :: "l"(sq->db),"r"(new_db) : "memory");

//sq->tail_copy.store(new_tail, simt::memory_order_release);
// printf("wrote SQ_db: %llu\tcur_tail: %llu\tmove_count: %llu\tsq_tail: %llu\tsq_head: %llu\n", (unsigned long long) new_db, (unsigned long long) cur_tail, (unsigned long long) tail_move_count, (unsigned long long) (new_tail), (unsigned long long)(sq->head.load(simt::memory_order_acquire)));
Expand Down Expand Up @@ -476,8 +477,10 @@ void cq_dequeue(nvm_queue_t* cq, uint16_t pos, nvm_queue_t* sq, uint32_t loc_ =

uint32_t new_db = (new_head) & (cq->qs_minus_1);

*(cq->db) = new_db;
//cq->head_copy.store(new_head, simt::memory_order_release);
//*(cq->db) = new_db;
asm volatile ("st.mmio.relaxed.sys.global.u32 [%0], %1;" :: "l"(cq->db),"r"(new_db) : "memory");

//cq->head_copy.store(new_head, simt::memory_order_release);
// printf("wrote CQ_db: %llu\tcur_head: %llu\tmove_count: %llu\tcq_head: %llu\tcq_tail: %llu\n", (unsigned long long) new_db, (unsigned long long) cur_head, (unsigned long long) head_move_count, (unsigned long long) (new_head), (unsigned long long)(cq->tail.load(simt::memory_order_acquire)));
cq->head.store(new_head, simt::memory_order_release);//axed);

Expand Down

0 comments on commit d20ef4a

Please sign in to comment.