CUDA는 배정 밀도 데이터를 감소해야 프로그램, 나는 줄리앙 Demouth의 이름 슬라이드 사용 "셔플 : 팁과 트릭"배정 밀도 데이터를위한 CUDA의 워프 셔플는
을 셔플 기능은 다음과 같습니다 :
/*for shuffle of double-precision point */
__device__ __inline__ double shfl(double x, int lane)
{
int warpSize = 32;
// Split the double number into 2 32b registers.
int lo, hi;
asm volatile("mov.b32 {%0,%1}, %2;":"=r"(lo),"=r"(hi):"d"(x));
// Shuffle the two 32b registers.
lo = __shfl_xor(lo,lane,warpSize);
hi = __shfl_xor(hi,lane,warpSize);
// Recreate the 64b number.
asm volatile("mov.b64 %0,{%1,%2};":"=d"(x):"r"(lo),"r"(hi));
return x;
}
현재 프로그램을 컴파일하는 동안 아래 오류가 있습니다.
ptxas /tmp/tmpxft_00002cfb_00000000-5_csr_double.ptx, line 71; error : Arguments mismatch for instruction 'mov'
ptxas /tmp/tmpxft_00002cfb_00000000-5_csr_double.ptx, line 271; error : Arguments mismatch for instruction 'mov'
ptxas /tmp/tmpxft_00002cfb_00000000-5_csr_double.ptx, line 287; error : Arguments mismatch for instruction 'mov'
ptxas /tmp/tmpxft_00002cfb_00000000-5_csr_double.ptx, line 302; error : Arguments mismatch for instruction 'mov'
ptxas /tmp/tmpxft_00002cfb_00000000-5_csr_double.ptx, line 317; error : Arguments mismatch for instruction 'mov'
ptxas /tmp/tmpxft_00002cfb_00000000-5_csr_double.ptx, line 332; error : Arguments mismatch for instruction 'mov'
ptxas fatal : Ptx assembly aborted due to errors
make: *** [csr_double] error 255
누군가가 조언을 줄 수 있습니까?
귀하의 문제는 중괄호라고 생각합니다. 나는 그들이 gcc (최소한 i386에서)에 특정한 의미를 가지고 있으며 어셈블러로 전달되기 전에 소비된다는 것을 믿는다. -S 출력이 어떻게 보이는지 보는 것은 흥미로울 것입니다. 특히 인라인 asm에 대한 APP 섹션. –
@DavidWohlferd : 중괄호는 완전하며 코드를 컴파일하는 gcc가 아닙니다. NVIDIA의 lvmm 기반 GPU 컴파일러입니다. – talonmies
@talonmies 더 의미가 있습니다. 확실히 gcc처럼 보일지 모르지만, 그렇다면 절대로 작동하지 않을 수 있습니다. –