diff --git a/src/runtime/metal/metal_module.mm b/src/runtime/metal/metal_module.mm index 4d9ffec84e45e55eb5099475521dac2c100db9e3..ed7cba6e75a5bfd63308606d981012229429a9c4 100644 --- a/src/runtime/metal/metal_module.mm +++ b/src/runtime/metal/metal_module.mm @@ -83,21 +83,24 @@ class MetalModuleNode final :public runtime::ModuleNode { if (e.lib == nil) { if (fmt_ == "metal") { MTLCompileOptions *opts = [MTLCompileOptions alloc]; - // Use the default setting for now. - // by default most recent version is used. - // opts.languageVersion = MTLLanguageVersion2_0; - // opts.fastMathEnabled = YES; - opts = nil; + // Use the Metal 1.2 for now. + opts.languageVersion = MTLLanguageVersion1_2; + opts.fastMathEnabled = YES; + // opts = nil; e.lib = [ w->devices[device_id] newLibraryWithSource:[NSString stringWithUTF8String:data_.c_str()] options:opts error:&err_msg]; [opts dealloc]; - if (err_msg != nil || e.lib == nil) { + if (e.lib == nil) { LOG(FATAL) << "Fail to compile metal lib:" << [[err_msg localizedDescription] UTF8String]; } + if (err_msg != nil) { + LOG(INFO) << "Warning: " + << [[err_msg localizedDescription] UTF8String]; + } } else { // Build from library. auto q = dispatch_queue_create("q", DISPATCH_QUEUE_SERIAL);