Skip to content
Draft
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
56 changes: 56 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"files.associations": {
"*.json": "jsonc",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"typeinfo": "cpp",

},

}
36 changes: 36 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Simple Linux build script for gemv_quantv1.cpp using OpenCL
# Usage: ./build.sh [output_name]
set -euo pipefail

CXX=${CXX:-g++}
SRC=gemv_quantv1.cpp
OUT=${1:-gemv_quantv1}
CXXFLAGS_DEFAULT="-O3 -std=c++17 -DNDEBUG"
CXXFLAGS=${CXXFLAGS:-$CXXFLAGS_DEFAULT}

# Gather OpenCL flags via pkg-config when available; otherwise fall back to -lOpenCL
CL_CFLAGS=""
CL_LDFLAGS=""
if command -v pkg-config >/dev/null 2>&1 && pkg-config --exists OpenCL; then
CL_CFLAGS="$(pkg-config --cflags OpenCL)"
CL_LDFLAGS="$(pkg-config --libs OpenCL)"
else
# Fallback: common system defaults
CL_LDFLAGS="-lOpenCL"
fi

# Optional manual overrides similar to the Windows .bat
# e.g. OPENCL_HEADERS=/usr/include OPENCL_LIB=/usr/lib/x86_64-linux-gnu ./build.sh
if [[ -n "${OPENCL_HEADERS:-}" ]]; then
CL_CFLAGS+=" -I${OPENCL_HEADERS}"
fi
if [[ -n "${OPENCL_LIB:-}" ]]; then
CL_LDFLAGS+=" -L${OPENCL_LIB}"
fi

set -x
"${CXX}" ${CXXFLAGS} ${CL_CFLAGS} -o "${OUT}" "${SRC}" ${CL_LDFLAGS}
set +x

echo "Build finished: ${OUT}"
Binary file added gemv_quantv1
Binary file not shown.
Loading