Initial commit
This commit is contained in:
16
ai_kernel.aura
Normal file
16
ai_kernel.aura
Normal file
@@ -0,0 +1,16 @@
|
||||
// Definiujemy matematyczne zasady dla pamięci:
|
||||
// Wymiar macierzy musi być większy od zera.
|
||||
type ValidDim = i32{d | d > 0}
|
||||
|
||||
// Indeks wątku na GPU (thread_id) nie może być ujemny.
|
||||
type SafeIndex = i32{i | i >= 0}
|
||||
|
||||
// Jądro GPU: Czysta funkcja, brak globalnego stanu, brak wyścigów danych!
|
||||
gpu fn matmul_step(weight: f32, activation: f32, current_sum: f32) -> f32:
|
||||
// Niewidzialny Borrow Checker konsumuje 'weight' i 'activation'
|
||||
let product = weight * activation
|
||||
|
||||
// Konsumujemy 'current_sum' i 'product'
|
||||
let new_sum = current_sum + product
|
||||
|
||||
return new_sum
|
||||
Reference in New Issue
Block a user