[Metal] GPUStartTime/GPUEndTime availability
Hi,
i'm trying to build a program that use Metal on MacOS 12.1 and 10.13 but I have an issue on 10.13.
GPUStartTime and GPUEndTime are defined available only with iOS, as defined in MTLCommandBuffer.h:
@property (readonly) CFTimeInterval GPUStartTime NS_AVAILABLE_IOS(10_3);
@property (readonly) CFTimeInterval GPUEndTime NS_AVAILABLE_IOS(10_3);
On MacOS 12.1 these defines was changed to:
@property (readonly) CFTimeInterval GPUStartTime API_AVAILABLE(macos(10.15), macCatalyst(13.0), ios(10.3));
@property (readonly) CFTimeInterval GPUEndTime API_AVAILABLE(macos(10.15), macCatalyst(13.0), ios(10.3));
The goal is not to use those two features on MacOS 10.13, but to find a solution to avoid not having the program compile without having to change the standard Metal headers that the default operating system provides.
I already tried with the following clang diagnostic pragmas, but nothing works
#pragma clang diagnostic ignored "-Wunsupported-availability-guard"
#pragma clang diagnostic ignored "-Wunguarded-availability"
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
#pragma clang diagnostic ignored "-Wunavailable-declarations"
#pragma clang diagnostic ignored "-Wavailability"
#pragma clang diagnostic ignored "-Wpartial-availability"
I got the same error:
error: 'GPUStartTime' is unavailable: not available on macOS
How to workaround this limitation?
Thanks!
Gabriele
MacBook Pro 13″, macOS 10.13