@@ -38,10 +38,6 @@ class LLVM_LIBRARY_VISIBILITY SPIRTargetInfo : public TargetInfo {
3838public:
3939 SPIRTargetInfo (const llvm::Triple &Triple, const TargetOptions &)
4040 : TargetInfo(Triple) {
41- assert (getTriple ().getOS () == llvm::Triple::UnknownOS &&
42- " SPIR target must use unknown OS" );
43- assert (getTriple ().getEnvironment () == llvm::Triple::UnknownEnvironment &&
44- " SPIR target must use unknown environment type" );
4541 TLSSupported = false ;
4642 VLASupported = false ;
4743 LongWidth = LongAlign = 64 ;
@@ -127,6 +123,43 @@ class LLVM_LIBRARY_VISIBILITY SPIR64TargetInfo : public SPIRTargetInfo {
127123 void getTargetDefines (const LangOptions &Opts,
128124 MacroBuilder &Builder) const override ;
129125};
126+
127+ class LLVM_LIBRARY_VISIBILITY SPIR32SYCLDeviceTargetInfo
128+ : public SPIR32TargetInfo {
129+ public:
130+ SPIR32SYCLDeviceTargetInfo (const llvm::Triple &Triple,
131+ const TargetOptions &Opts)
132+ : SPIR32TargetInfo(Triple, Opts) {
133+ // This is workaround for exception_ptr class.
134+ // Exceptions is not allowed in sycl device code but we should be able
135+ // to parse host code. So we allow compilation of exception_ptr but
136+ // if exceptions are used in device code we should emit a diagnostic.
137+ MaxAtomicInlineWidth = 32 ;
138+ // This is workaround for mutex class.
139+ // I'm not sure about this hack but I guess that mutex_class is same
140+ // problem.
141+ TLSSupported = true ;
142+ }
143+ };
144+
145+ class LLVM_LIBRARY_VISIBILITY SPIR64SYCLDeviceTargetInfo
146+ : public SPIR64TargetInfo {
147+ public:
148+ SPIR64SYCLDeviceTargetInfo (const llvm::Triple &Triple,
149+ const TargetOptions &Opts)
150+ : SPIR64TargetInfo(Triple, Opts) {
151+ // This is workaround for exception_ptr class.
152+ // Exceptions is not allowed in sycl device code but we should be able
153+ // to parse host code. So we allow compilation of exception_ptr but
154+ // if exceptions are used in device code we should emit a diagnostic.
155+ MaxAtomicInlineWidth = 64 ;
156+ // This is workaround for mutex class.
157+ // I'm not sure about this hack but I guess that mutex_class is same
158+ // problem.
159+ TLSSupported = true ;
160+ }
161+ };
162+
130163} // namespace targets
131164} // namespace clang
132165#endif // LLVM_CLANG_LIB_BASIC_TARGETS_SPIR_H
0 commit comments