-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add QNN Op package #1 #2840
Closed
Closed
Add QNN Op package #1 #2840
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
subdir('qnn') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//============================================================================ | ||
// | ||
// Copyright (c) 2020-2022 Qualcomm Technologies, Inc. | ||
// All Rights Reserved. | ||
// Confidential and Proprietary - Qualcomm Technologies, Inc. | ||
// | ||
//============================================================================ | ||
|
||
#pragma once | ||
|
||
#define DEBUG_ON 0 | ||
|
||
#if DEBUG_ON | ||
#define DEBUG_MSG(...) \ | ||
{ \ | ||
fprintf(stderr, __VA_ARGS__); \ | ||
fprintf(stderr, "\n"); \ | ||
} | ||
#else | ||
#define DEBUG_MSG(...) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
//============================================================================== | ||
// | ||
// Copyright (c) 2008-2014, 2020-2022 Qualcomm Technologies, Inc. | ||
// All Rights Reserved. | ||
// Confidential and Proprietary - Qualcomm Technologies, Inc. | ||
// | ||
//============================================================================== | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @file | ||
/// This file includes APIs for directory operations on supported platforms | ||
//--------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "PAL/FileOp.hpp" | ||
|
||
namespace pal { | ||
class Directory; | ||
} | ||
|
||
class pal::Directory { | ||
public: | ||
using DirMode = pal::FileOp::FileMode; | ||
//--------------------------------------------------------------------------- | ||
/// @brief | ||
/// Creates a directory in the file system. | ||
/// @param path | ||
/// Name of directory to create. | ||
/// @param dirmode | ||
/// Directory mode | ||
/// @return | ||
/// True if | ||
/// 1. create a directory successfully | ||
/// 2. or directory exist already | ||
/// False otherwise | ||
/// | ||
/// For example: | ||
/// | ||
/// - Create a directory in default. | ||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
/// pal::Directory::Create(path, pal::Directory::DirMode::S_DEFAULT_); | ||
/// pal::Directory::Create(path); | ||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
/// | ||
/// - Create a directory with specific permission. | ||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
/// pal::Directory::Create(path, pal::Directory::DirMode::S_IRWXU_| | ||
/// pal::Directory::DirMode::S_IRWXG_| | ||
/// pal::Directory::DirMode::S_IRWXO_); | ||
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
/// | ||
/// @note For windows, dirmode is not used. | ||
/// @note For linux, dirmode is used to set the permission of the folder. | ||
//--------------------------------------------------------------------------- | ||
static bool | ||
create(const std::string &path, | ||
pal::Directory::DirMode dirmode = pal::Directory::DirMode::S_DEFAULT_); | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @brief | ||
/// Removes the entire directory whether it's empty or not. | ||
/// @param path | ||
/// Name of directory to delete. | ||
/// @return | ||
/// True if the directory was successfully deleted, false otherwise. | ||
//--------------------------------------------------------------------------- | ||
static bool remove(const std::string &path); | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @brief | ||
/// Creates a directory and all parent directories required. | ||
/// @param path | ||
/// Path of directory to create. | ||
/// @return | ||
/// True if the directory was successfully created, false otherwise. | ||
//--------------------------------------------------------------------------- | ||
static bool makePath(const std::string &path); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
//============================================================================== | ||
// | ||
// Copyright (c) 2020-2022 Qualcomm Technologies, Inc. | ||
// All Rights Reserved. | ||
// Confidential and Proprietary - Qualcomm Technologies, Inc. | ||
// | ||
//============================================================================== | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @file | ||
/// This file includes APIs for dynamic loading on supported platforms | ||
//--------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace pal { | ||
namespace dynamicloading { | ||
// we only support subset of POSIX of dlopen/dlsym/dladdr/dlerror/dlclose | ||
// except the following flags for dlopen, others should be done only | ||
// when we really need them | ||
// DL_NOW is MUST | ||
// DL_LOCAL is enabled if not specified | ||
enum { | ||
DL_NOW = 0x0001, | ||
DL_LOCAL = 0x0002, | ||
DL_GLOBAL = 0x0004, | ||
}; | ||
|
||
// specify this address to distingiush from NULL pointer | ||
#define DL_DEFAULT (void *)(0x4) | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @brief | ||
/// Loads the dynamic shared object | ||
/// @param filename | ||
/// If contains path separators, treat it as relative or absolute pathname | ||
/// or search it for the rule of dynamic linker | ||
/// @param flags | ||
/// - DL_NOW: resolve undefined symbols before return. MUST be specified. | ||
/// - DL_LOCAL: optional, but the default specified. Symbols defined in this | ||
/// shared object are not made available to resolve references in | ||
/// subsequently loaded shared objects | ||
/// - DL_GLOBAL: optional, resolve symbol globally | ||
/// @return | ||
/// On success, a non-NULL handle for the loaded library. | ||
/// On error, NULL | ||
//--------------------------------------------------------------------------- | ||
void *dlOpen(const char *filename, int flags); | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @brief | ||
/// Obtain address of a symbol in a shared object or executable | ||
/// @param handle | ||
/// A handle of a dynamic loaded shared object returned by dlopen | ||
/// @param symbol | ||
/// A null-terminated symbol name | ||
/// @return | ||
/// On success, return the address associated with symbol | ||
/// On error, NULL | ||
//--------------------------------------------------------------------------- | ||
void *dlSym(void *handle, const char *symbol); | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @brief | ||
/// Translate the address of a symbol to the path of the belonging shared | ||
/// object | ||
/// @param addr | ||
/// Address of symbol in a shared object | ||
/// @param path | ||
/// Full name of shared object that contains address, usually it is an | ||
/// absolute path | ||
/// @return | ||
/// On success, return a non-zero value | ||
/// On error, return 0 | ||
//--------------------------------------------------------------------------- | ||
int dlAddrToLibName(void *addr, std::string &name); | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @brief | ||
/// Decrements the reference count on the dynamically loaded shared object | ||
/// referred to by handle. If the reference count drops to 0, then the | ||
/// object is unloaded. | ||
/// @return | ||
/// On success, 0; on error, a nonzero value | ||
//--------------------------------------------------------------------------- | ||
int dlClose(void *handle); | ||
|
||
//--------------------------------------------------------------------------- | ||
/// @brief | ||
/// Obtain error diagnostic for functions in the dl-family APIs. | ||
/// @return | ||
/// Returns a human-readable, null-terminated string describing the most | ||
/// recent error that occurred from a call to one of the functions in the | ||
/// dl-family APIs. | ||
//--------------------------------------------------------------------------- | ||
char *dlError(void); | ||
|
||
} // namespace dynamicloading | ||
} // namespace pal |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about setting the default value of
enable-qnn
as false?