livoxG1: Add OpenCl kernels for collation

This commit is contained in:
2025-11-08 10:26:17 -04:00
parent b460c8b2d3
commit 9233f7fdc8
4 changed files with 48 additions and 0 deletions
+11
View File
@@ -37,12 +37,23 @@ if(ENABLE_STIMBUFFAPI_livoxGen1)
message(STATUS "Found OpenCL using pkg-config")
endif()
# Enable assembly language
enable_language(ASM)
add_library(livoxGen1 SHARED
livoxGen1.cpp
stagingBuffer.cpp
pcloudStimulusBuffer.cpp
ioUringAssemblyEngine.cpp
openClCollatingAndMeshingEngine.cpp
openClKernels.cl.S
)
# Set assembler working directory so .incbin can find the .cl file
# Also declare dependency on collateDgrams.cl
set_source_files_properties(openClKernels.cl.S PROPERTIES
COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/collateDgrams.cl"
)
target_include_directories(livoxGen1 PUBLIC
+3
View File
@@ -0,0 +1,3 @@
__kernel void collate(__global uchar* assembly, __global uchar* collation) {
// Placeholder kernel - will be replaced with actual collation logic
}
+17
View File
@@ -0,0 +1,17 @@
.section .rodata
.global collateKernelStart
.global collateKernelEnd
.global collateKernelNBytes
.type collateKernelStart, @object
.type collateKernelEnd, @object
.type collateKernelNBytes, @object
collateKernelStart:
.incbin "collateDgrams.cl"
collateKernelEnd:
.section .data
collateKernelNBytes:
.quad collateKernelEnd - collateKernelStart
.section .note.GNU-stack,"",@progbits
+17
View File
@@ -0,0 +1,17 @@
#ifndef _LIVOX_GEN1_OPENCL_KERNELS_H
#define _LIVOX_GEN1_OPENCL_KERNELS_H
#include <cstddef>
namespace smo {
namespace stim_buff {
// External symbols for collate kernel
extern const char collateKernelStart[];
extern const char collateKernelEnd[];
extern const size_t collateKernelNBytes;
} // namespace stim_buff
} // namespace smo
#endif // _LIVOX_GEN1_OPENCL_KERNELS_H