Skip to content

Commit

Permalink
Work around Impala parser bug AnyDSL/impala#90
Browse files Browse the repository at this point in the history
  • Loading branch information
richardmembarth committed Jan 14, 2022
1 parent b241b3b commit 731767f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions platforms/impala/intrinsics_cuda.impala
Original file line number Diff line number Diff line change
Expand Up @@ -280,37 +280,37 @@ fn @cuda_lanemask_gt() -> u32 {

fn @cuda_clock() -> u32 {
let mut cycle_count:u32;
asm("mov.u32 %0, %clock;" : "=r"(cycle_count) ::: "volatile");
asm("mov.u32 %0, %clock;" : "=r"(cycle_count) : :: "volatile");
cycle_count
}

fn @cuda_clock_hi() -> u32 {
let mut cycle_count:u32;
asm("mov.u32 %0, %clock_hi;" : "=r"(cycle_count) ::: "volatile");
asm("mov.u32 %0, %clock_hi;" : "=r"(cycle_count) : :: "volatile");
cycle_count
}

fn @cuda_clock64() -> u64 {
let mut cycle_count:u64;
asm("mov.u64 %0, %clock64;" : "=l"(cycle_count) ::: "volatile");
asm("mov.u64 %0, %clock64;" : "=l"(cycle_count) : :: "volatile");
cycle_count
}

fn @cuda_globaltimer() -> u64 {
let mut timestamp:u64;
asm("mov.u64 %0, %globaltimer;" : "=l"(timestamp) ::: "volatile");
asm("mov.u64 %0, %globaltimer;" : "=l"(timestamp) : :: "volatile");
timestamp
}

fn @cuda_globaltimer_lo() -> u32 {
let mut timestamp:u32;
asm("mov.u32 %0, %globaltimer_lo;" : "=r"(timestamp) ::: "volatile");
asm("mov.u32 %0, %globaltimer_lo;" : "=r"(timestamp) : :: "volatile");
timestamp
}

fn @cuda_globaltimer_hi() -> u32 {
let mut timestamp:u32;
asm("mov.u32 %0, %globaltimer_hi;" : "=r"(timestamp) ::: "volatile");
asm("mov.u32 %0, %globaltimer_hi;" : "=r"(timestamp) : :: "volatile");
timestamp
}

Expand Down
12 changes: 6 additions & 6 deletions platforms/impala/intrinsics_nvvm.impala
Original file line number Diff line number Diff line change
Expand Up @@ -500,37 +500,37 @@ fn @nvvm_nanosleep(t: u32) -> () {

fn @nvvm_clock() -> u32 {
let mut cycle_count:u32;
asm("mov.u32 $0, %clock;" : "=r"(cycle_count) ::: "volatile");
asm("mov.u32 $0, %clock;" : "=r"(cycle_count) : :: "volatile");
cycle_count
}

fn @nvvm_clock_hi() -> u32 {
let mut cycle_count:u32;
asm("mov.u32 $0, %clock_hi;" : "=r"(cycle_count) ::: "volatile");
asm("mov.u32 $0, %clock_hi;" : "=r"(cycle_count) : :: "volatile");
cycle_count
}

fn @nvvm_clock64() -> u64 {
let mut cycle_count:u64;
asm("mov.u64 $0, %clock64;" : "=l"(cycle_count) ::: "volatile");
asm("mov.u64 $0, %clock64;" : "=l"(cycle_count) : :: "volatile");
cycle_count
}

fn @nvvm_globaltimer() -> u64 {
let mut timestamp:u64;
asm("mov.u64 $0, %globaltimer;" : "=l"(timestamp) ::: "volatile");
asm("mov.u64 $0, %globaltimer;" : "=l"(timestamp) : :: "volatile");
timestamp
}

fn @nvvm_globaltimer_lo() -> u32 {
let mut timestamp:u32;
asm("mov.u32 $0, %globaltimer_lo;" : "=r"(timestamp) ::: "volatile");
asm("mov.u32 $0, %globaltimer_lo;" : "=r"(timestamp) : :: "volatile");
timestamp
}

fn @nvvm_globaltimer_hi() -> u32 {
let mut timestamp:u32;
asm("mov.u32 $0, %globaltimer_hi;" : "=r"(timestamp) ::: "volatile");
asm("mov.u32 $0, %globaltimer_hi;" : "=r"(timestamp) : :: "volatile");
timestamp
}

Expand Down

0 comments on commit 731767f

Please sign in to comment.