원클릭으로
paddle-style-default-device
Implement PaddlePaddle-style lazy GPU default device in C++ core, all languages inherit
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Implement PaddlePaddle-style lazy GPU default device in C++ core, all languages inherit
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Add device information query functions through HAL → ins:: API → language bindings
Add --device all/--timer/--info CLI flags to demos across all languages for competition scoring
Add composite signal operators using existing primitives (no dedicated backend kernels needed)
How to port a cusignal Python/CUDA module to ins::signal C++ using Insight7 primitives and HAL
Profile and optimize binding language (Lua/Julia/Python) demo performance to match or exceed C++ baseline
busted loads _insight.so from ~/.luarocks/lib first, not build/ — must copy .so after rebuild
SOC 직업 분류 기준
| name | paddle-style-default-device |
| description | Implement PaddlePaddle-style lazy GPU default device in C++ core, all languages inherit |
| source | auto-skill |
| extracted_at | 2026-06-05T14:22:08.096Z |
Problem: PaddlePaddle defaults to GPU when available, CPU otherwise. Insight7 should match this behavior.
Implementation (in src/core/place.cpp):
namespace {
thread_local Place g_default_device = CPUPlace();
thread_local bool g_device_explicitly_set = false;
}
Place get_device() {
// Lazy: first call checks if GPU is available
if (!g_device_explicitly_set && g_default_device.kind() == DeviceKind::CPU) {
if (is_device_available(DeviceKind::GPU)) {
g_default_device = GPUPlace(0);
}
}
return g_default_device;
}
void set_device(const Place &place) {
g_default_device = place;
g_device_explicitly_set = true; // User's choice is honored
}
Key design:
g_device_explicitly_set flag ensures set_device(CPUPlace()) is honoredis_device_available(DeviceKind::GPU) handles ALL backends (cuda/npu/rocm/...)Binding requirements:
set_device and get_devicecreation.py MUST call get_device() at call time, NOT at module load time:
# ❌ WRONG — evaluated once at import
m.def("zeros", &zeros, py::arg("place") = get_device());
# ✅ CORRECT — evaluated at each call
def zeros(shape, dtype, place=None):
if place is None:
return _native_zeros(shape, dtype, get_device())
set_device(CPUPlace()) in setup (conftest.py for Python, setup block for Lua/busted)Why: PaddlePaddle does this in _current_expected_place_() — checks is_compiled_with_cuda() + get_cuda_device_count(). Insight7's HAL abstraction makes it simpler: one is_device_available() check.