Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//-----------------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please double check the copyrights, I could see the following copyrights used in CPP files.
Can you please check this once from Jeff.
//-----------------------------------------------------------------------------
//
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc. and/or its subsidiaries.
//
//-----------------------------------------------------------------------------

//
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// SPDX-License-Identifier: BSD-3-Clause
//
//-----------------------------------------------------------------------------

#include "CustomOpAICInterface.h"
#include "stddef.h"

extern "C" {

/* The AIC compilation target supports an API similar to the Interpreter API.
Additionally, threadId, which is the AIC thread ID, is passed.
Kernel is invoked by four AIC threads with threadId equal to 0, 1, 2, and 3. */

void CustomGELUAIC(
const CustomOpContext *ctx,
const int32_t threadId)
{
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// SPDX-License-Identifier: BSD-3-Clause
//
//-----------------------------------------------------------------------------

#include "CustomOpFunctions.h"
#include "CustomOpInterpreterInterface.h"
#include "CustomOpTileConfigHelpers.h"
#include "CustomOpTypes.h"

#include <string.h>

extern "C" {
bool customOpVerify(
const CustomOpPropertiesHandle *const opProp)
{
/* Refer to function declaration at CustomOpFunctions.h for usage. */

return true;
}

const char * customOpSelectImpl(
const CustomOpPropertiesHandle *const opProp,
const CustomOpKernelInfo *const kernelInfos,
const int32_t numKernels,
const char *backend)
{
/* Refer to function declaration at CustomOpFunctions.h for usage. */

/* For AIC pick '<OpName>AIC', for Interpreter pick '<OpName>Interpreter' */
if (strcmp(backend, "AIC") == 0)
{
return "";
}
else if (strcmp(backend, "Interpreter") == 0)
{
return "";
}
return nullptr;
}

bool customOpInferShape(
CustomOpPropertiesHandle *const opProp)
{
/* Refer to function declaration at CustomOpFunctions.h for usage. */

return false;
}

bool customOpSetProperties(
CustomOpPropertiesHandle *opProp)
{
/* Refer to function declaration at CustomOpFunctions.h for usage. */

return false;
}

bool customOpMapTiles(
CustomOpPropertiesHandle *opProp)
{
/* Refer to function declaration at CustomOpFunctions.h for usage. */

return false;
}
void customOpDeallocateMemory(
CustomOpPropertiesHandle *opProp)
{
/* Refer to function declaration at CustomOpFunctions.h for usage. */

CustomOpTileConfigHelpers::destroyTileConfigsAndMergeConfigs(opProp);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// SPDX-License-Identifier: BSD-3-Clause
//
//-----------------------------------------------------------------------------

/*
* This file can be compiled separately and can be loaded using dlopen
* Compilation command: (tried with gcc 5.5)
* g++ -shared -std=c++11 -fPIC -o <opName>_lib.so <opName_functions>.cpp <opName_interpreter>.cpp -I/opt/qti-aic/dev/inc
* for example: g++ -shared -std=c++11 -fPIC -o reluop_lib.so reluop_functions.cpp reluop_interpreter.cpp -I/opt/qti-aic/dev/inc
*/

#include "CustomOpInterpreterInterface.h"

extern "C" {
void CustomGELUInterpreter(
CustomOpContext *ctx)
{
/* The interpreter implementation is provided to the compiler as a shared library
(or collection of shared libraries). Each shared library can contain multiple
versions (flavors) of implementations of the operation, refered onwards as kernels.
A kernel is selected at model compilation time by the selection function. The
developer is responsible for compilation of these shared libraries. As the interface
is C, the shared libraries can be compiled by various compilers (GCC, CLANG, etc).
In addition, as these shared libraries are running on the Host CPU, the developer
can open files, dump results, use stdout/stderr for printing debug messages, etc.
This makes the Interpreter implementation a very effective way for debugging the
operation functionality as part of model execution. The signature of the
kernel (implementation) is generic, and fits any custom operation. */
}
}
Binary file not shown.
Loading
Loading