• AlmightySnoo 🐢🇮🇱🇺🇦@lemmy.worldOP
    link
    fedilink
    arrow-up
    30
    arrow-down
    1
    ·
    1 year ago

    In CUDA, the corresponding malloc cannot return the pointer to the allocated memory as runtime CUDA functions all return error codes instead. So the only way to “return” the pointer then without a return statement is to have a pointer given to that function by address, which means that you’ll have a pointer-to-pointer among its arguments.