__global__ İşlev Belirteci
Bir işlevi GPU çekirdeği olarak işaretleyin.
__global__ İşlev Belirteci, CoddyKit'te ücretsiz bir CUDA Academy dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, CUDA Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. CUDA Academy kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Two Worlds, Two Compilers
Your CUDA file holds both CPU and GPU code. A tiny keyword tells the compiler which side a function belongs to. That keyword is the function qualifier. ⚡
Meet __global__
The __global__ qualifier marks a function as a GPU kernel: code the CPU launches but the GPU actually runs across many threads.
__global__ void myKernel() {
// runs on the GPU
}Called Here, Runs There
A __global__ function is the only kind the host can call but the device executes. It is the bridge between your two worlds.
Always Returns void
A kernel must return void. It cannot hand a value back to the CPU, so results travel out through memory instead.
__global__ void addOne(int* data) {
data[0] += 1;
}Launching Is Asynchronous
When you launch a __global__ kernel, the CPU does not wait. The call returns instantly while the GPU works in the background. 🚀
Many Threads, One Function
One __global__ definition runs on thousands of threads at once. You write the body once; the GPU clones the work across cores.
The Launch Syntax
Calling a kernel needs special triple angle brackets that set how many threads run. Normal parentheses alone will not do.
myKernel<<<1, 256>>>();Parameters by Value
Kernel arguments are copied to the device. Pass device pointers for arrays, since a host pointer would be meaningless on the GPU.
Not the Same as __device__
Do not confuse them: __global__ is a launchable entry point, while __device__ functions are helpers callable only from GPU code.
No Recursion at the Entry
A __global__ kernel cannot call itself directly the way host functions do. Classic recursion belongs to device helper functions instead.
Why It Matters
Mastering __global__ unlocks everything ahead: every kernel you write, launch, and tune starts with this one little keyword.
Quick Check
Let us check your grasp of the __global__ qualifier.
Recap
You learned that __global__ marks a GPU kernel: called by the host, run by the device, returns void, and launched with triple angle brackets. 🎉
Sıkça Sorulan Sorular
“__global__ İşlev Belirteci” dersi ücretsiz mi?
Evet — “__global__ İşlev Belirteci” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve CUDA Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. CUDA Academy kursu toplamda 4 dersten oluşur.
“__global__ İşlev Belirteci” dersinde ne öğreneceğim?
Bir işlevi GPU çekirdeği olarak işaretleyin. CUDA Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
CUDA Academy öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te CUDA Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.
“__global__ İşlev Belirteci” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu CUDA Academy dersinde kod yazıp çalıştırabilir miyim?
Evet. Her CUDA Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- __global__ İşlev Belirteci
- __device__ ve __host__ İşlevleri
- Ayrı Adres Alanları
- Bir CUDA Programının Yaşam Döngüsü