Skip to content

Commit ee11f02

Browse files
committed
Stablize build
1 parent 60b8e5a commit ee11f02

File tree

7 files changed

+434
-54
lines changed

7 files changed

+434
-54
lines changed

.github/workflows/codeql.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,35 @@ jobs:
3939
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
4040

4141
steps:
42-
- name: Checkout repository
43-
uses: actions/checkout@v4
42+
- name: Cache bazel
43+
uses: actions/cache@v4
44+
env:
45+
cache-name: bazel-cache
46+
with:
47+
path: |
48+
~/.cache/bazelisk
49+
~/.cache/bazel
50+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.ref }}
51+
restore-keys: |
52+
${{ runner.os }}-${{ env.cache-name }}-development
4453
45-
# Initializes the CodeQL tools for scanning.
46-
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v3
48-
with:
49-
languages: ${{ matrix.language }}
50-
# If you wish to specify custom queries, you can do so here or in a config file.
51-
# By default, queries listed here will override any specified in a config file.
52-
# Prefix the list here with "+" to use these queries and those in the config file.
53-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
54+
- name: Install Dependencies
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install -y libxml2-dev ocl-icd-opencl-dev
5458
55-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
56-
# If this step fails, then you should remove it and run the build manually (see below)
57-
# - name: Autobuild
58-
# uses: github/codeql-action/autobuild@v3
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
5961

60-
# ℹ️ Command-line programs to run using the OS shell.
61-
# 📚 https://git.io/JvXDl
62+
# Initializes the CodeQL tools for scanning.
63+
- name: Initialize CodeQL
64+
uses: github/codeql-action/init@v3
65+
with:
66+
languages: ${{ matrix.language }}
6267

63-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
64-
# and modify them (or add more) to build your code if your project
65-
# uses a compiled language
68+
# build
69+
- name: Build the code
70+
run: bazel build //...
6671

67-
# build
68-
- name: Build the code
69-
run: bazel build //...
70-
71-
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@v3
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v3

include/VX/vx_corevx_ext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ enum vx_kernel_ext_e
4646
* \brief The ONNX Runtime CPU Inference kernel.
4747
*/
4848
VX_KERNEL_ORT_CPU_INF = VX_KERNEL_BASE(VX_ID_EDGE_AI, VX_LIBRARY_KHR_BASE) + 0x1,
49+
/*!
50+
* \brief The AI Model Server Chatbot kernel.
51+
*/
52+
VX_KERNEL_AIS_CHATBOT = VX_KERNEL_BASE(VX_ID_EDGE_AI, VX_LIBRARY_KHR_BASE) + 0x2,
4953
};
5054

5155
/*! \brief addtitional tensor attributes.

targets/ai_server/BUILD

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
cc_library(
3+
name = "ai-server",
4+
srcs = glob([
5+
"*.cpp",
6+
"*.h",
7+
]),
8+
includes = [
9+
".",
10+
"//framework/include",
11+
# "//kernels/ai-server",
12+
],
13+
deps = [
14+
"//:corevx",
15+
# "//kernels/ai-server:ai-server-kernels",
16+
],
17+
visibility = ["//visibility:public"]
18+
)
19+
20+
cc_shared_library(
21+
name = "openvx-ai-server",
22+
deps = [
23+
":ai-server",
24+
],
25+
visibility = ["//visibility:public"]
26+
)
27+
28+
cc_import(
29+
name = "imported_openvx_ai_server",
30+
shared_library = ":openvx-ai-server",
31+
visibility = ["//visibility:public"]
32+
)

targets/ai_server/vx_chatbot.cpp

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
* @file vx_chatbot.cpp
3+
* @brief OpenVX Interface Into AI Model Server
4+
* @version 0.1
5+
* @date 2025-01-20
6+
*
7+
* @copyright Copyright (c) 2025
8+
*
9+
*/
10+
#include <iostream>
11+
#include <string>
12+
13+
#include <VX/vx.h>
14+
#include <VX/vx_compatibility.h>
15+
#include <VX/vx_helper.h>
16+
#include <VX/vx_lib_debug.h>
17+
18+
#include "ort_runner.hpp"
19+
#include "vx_internal.h"
20+
21+
class VxRemoteModelClient
22+
{
23+
public:
24+
static constexpr vx_param_description_t kernelParams[] = {
25+
{VX_INPUT, VX_TYPE_STRING, VX_PARAMETER_STATE_REQUIRED}, // Parameter 0: Input text
26+
{VX_OUTPUT, VX_TYPE_STRING, VX_PARAMETER_STATE_REQUIRED}, // Parameter 1: Output text
27+
};
28+
29+
static vx_status VX_CALLBACK init(vx_node node, const vx_reference parameters[], vx_uint32 num)
30+
{
31+
(void)node;
32+
(void)parameters;
33+
(void)num;
34+
return VX_SUCCESS;
35+
}
36+
37+
static vx_status VX_CALLBACK validate(vx_node node, const vx_reference parameters[], vx_uint32 num, vx_meta_format metas[])
38+
{
39+
(void)node;
40+
(void)parameters;
41+
(void)num;
42+
(void)metas;
43+
return VX_SUCCESS;
44+
}
45+
46+
static vx_status VX_CALLBACK run(vx_node node, const vx_reference *parameters, vx_uint32 num)
47+
{
48+
(void)node;
49+
(void)parameters;
50+
(void)num;
51+
return VX_SUCCESS;
52+
}
53+
};
54+
55+
/**
56+
* @brief Ai Model Server Chatbot Kernel description structure
57+
*/
58+
vx_kernel_description_t chatbot_kernel = {
59+
VX_KERNEL_AIS_CHATBOT, // Unique kernel ID
60+
"remote.model.chat", // Kernel name
61+
VxRemoteModelClient::run, // Kernel execution function
62+
const_cast<vx_param_description_t *>(VxRemoteModelClient::kernelParams),
63+
dimof(VxRemoteModelClient::kernelParams), // Number of parameters
64+
VxRemoteModelClient::validate, // Kernel validation function
65+
nullptr,
66+
nullptr,
67+
VxRemoteModelClient::init, // Kernel initialization function
68+
nullptr};

0 commit comments

Comments
 (0)