You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [ctypes](https://docs.python.org/3/library/ctypes.html) approach relaxes the parameter preparation requirement by delegating the contiguous memory requirement to the API launch call.
446
446
447
-
Let's use the following kernel definition as an example:
448
-
```python
449
-
kernel_string ="""\
450
-
struct testStruct {
451
-
int value;
452
-
};
453
-
454
-
extern "C" __global__
455
-
void testkernel(int i, int *pi,
456
-
float f, float *pf,
457
-
struct testStruct s, struct testStruct *ps)
458
-
{
459
-
*pi = i;
460
-
*pf = f;
461
-
ps->value = s.value;
462
-
}
463
-
"""
464
-
```
447
+
Let's use the same kernel definition as the previous section for the example.
465
448
466
449
The ctypes approach treats the `kernelParams` argument as a pair of two tuples: `kernel_values` and `kernel_types`.
467
450
@@ -478,19 +461,19 @@ For this example the result becomes:
0 commit comments