Skip to content

Commit 94504ff

Browse files
Add Macro for Android api level
1 parent 997bd3d commit 94504ff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backends/qualcomm/runtime/backends/irbackend/aarch64/QnnDlcManager.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ Error QnnDlcManager::RegisterGraphsFromDLC(
7373
cache->GetQnnContextBlob();
7474

7575
// memfd_create on android api level 30 and above
76-
int fd = memfd_create("tmp.dlc", 0);
76+
int fd = -1;
77+
#ifdef __ANDROID__
78+
#if __ANDROID_API__ >= 30
79+
fd = memfd_create("tmp.dlc", 0);
80+
#endif
81+
#endif
7782
if (fd == -1) {
7883
QNN_EXECUTORCH_LOG_ERROR("memfd_create fail");
7984
return Error::Internal;

0 commit comments

Comments
 (0)