13 lines
377 B
JavaScript
13 lines
377 B
JavaScript
const statusElement = document.querySelector("#webgpu-status");
|
|
|
|
if (!(statusElement instanceof HTMLElement)) {
|
|
throw new Error("WebGPU status element is missing.");
|
|
}
|
|
|
|
if ("gpu" in navigator) {
|
|
statusElement.textContent = "WebGPU 사용 가능";
|
|
} else {
|
|
statusElement.textContent = "CPU fallback 사용 예정";
|
|
statusElement.classList.add("status-chip--warning");
|
|
}
|