[llvm] r233583 - [NVPTX] Associate a minimum PTX version for each SM architecture

Justin Holewinski jholewinski at nvidia.com
Thu Apr 2 11:06:15 PDT 2015


On Apr 2, 2015, at 1:55 PM, Artem Belevich <tra at google.com<mailto:tra at google.com>> wrote:

Hi,

On Mon, Mar 30, 2015 at 12:30 PM, Justin Holewinski <jholewinski at nvidia.com<mailto:jholewinski at nvidia.com>> wrote:
Author: jholewinski
Date: Mon Mar 30 14:30:55 2015
New Revision: 233583

URL: http://llvm.org/viewvc/llvm-project?rev=233583&view=rev
Log:
[NVPTX] Associate a minimum PTX version for each SM architecture

...
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTX.td?rev=233583&r1=233582&r2=233583&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTX.td (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTX.td Mon Mar 30 14:30:55 2015
@@ -46,10 +46,6 @@ def SM53 : SubtargetFeature<"sm_53", "Sm
                             "Target SM 5.3">;

 // PTX Versions
-def PTX30 : SubtargetFeature<"ptx30", "PTXVersion", "30",
-                             "Use PTX version 3.0">;
-def PTX31 : SubtargetFeature<"ptx31", "PTXVersion", "31",
-                             "Use PTX version 3.1">;
 def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32",
                              "Use PTX version 3.2">;
 def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40",
@@ -69,12 +65,12 @@ class Proc<string Name, list<SubtargetFe
 def : Proc<"sm_20", [SM20]>;
 def : Proc<"sm_21", [SM21]>;
 def : Proc<"sm_30", [SM30]>;
-def : Proc<"sm_32", [SM32]>;
+def : Proc<"sm_32", [SM32, PTX40]>;
 def : Proc<"sm_35", [SM35]>;

Does it mean that SM35/SM37 would still be using PTX3.2?

SM 3.7 requires PTX 4.1, and SM 3.5 uses PTX 3.2.  Note that these are the minimums, you can of course set a higher PTX version.


libdevice.compute_35.10.bc that ships with CUDA-7.0 uses "rsqrt.approx.ftz.f64". That instruction was added in PTX4.0 which suggests that SM35/37 may have to bumped to PTX 4.0, too.

The libdevice binaries for a particular CUDA release may require the corresponding PTX version released with that toolkit.  CUDA 7.0 uses PTX 4.2, so you should be targeting PTX 4.2 if you are using libdevice.  Regardless of SM architecture, a new PTX version may introduce new features.


--Artem


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150402/a1c4125a/attachment.html>


More information about the llvm-commits mailing list