<div dir="ltr"><div><div><div>Hi all,<br><br></div>Trying to compile a simple "device" function using llvm (3.7) and the ptx backend and I'm running into the following error.<br><br>"LLVM ERROR: Attempted to created cross-class register copy"<br><br></div>I've done some googling and can see a number of patches and discussions about this topic but I'm still not sure if I'm running into a legitimate error on my behalf or a bug. <br><br></div>The IR I'm trying to compile is<br><br><div><div>struct Point<br>{<br></div><div>    double val;<br>};<br></div><div><br>define void @StabilizeFunc(%struct.Point*, %struct.Point*) {<br>StabilizeBlock:<br>  %2 = getelementptr %struct.Point, %struct.Point* %1, i32 0, i32 0<br>  store double 2.000000e+00, double* %2<br>  ret void<br>}<br><br></div><div>I plan to JIT device functions like this and link them into a kernel function which I am writing by hand. <br>I've tried specifying a number of different address spaces for the pointers all with no luck. If I change the store to target a global variable in address space 5 (local) I get the function to successfully generate the PTX code.<br></div><div><br>I'd like to stick with version 3.7 and I'm willing to work around any issues.<br><div><br></div>Thanks in advanced,<br></div><div>Andrew<br></div><div><br><br></div></div></div>