diff --git a/src/runtime/metal/metal_device_api.mm b/src/runtime/metal/metal_device_api.mm index fddeadf86f62..0082cddcd809 100644 --- a/src/runtime/metal/metal_device_api.mm +++ b/src/runtime/metal/metal_device_api.mm @@ -1,3 +1,4 @@ + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -159,7 +160,7 @@ int GetWarpSize(id<MTLDevice> dev) { */ id<MTLBuffer> buf = [dev newBufferWithLength:nbytes options:storage_mode]; CHECK(buf != nil); - return (__bridge void*)([buf retain]); + return (void*)(CFBridgingRetain(buf)); } void MetalWorkspace::FreeDataSpace(TVMContext ctx, void* ptr) {