GmAlloc
Supported Products
Product |
Supported/Unsupported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
x |
|
√ |
Functions
Creates shared memory during verification of the CPU-side operation of the kernel function. That is, creates a shared file in the /tmp directory and returns the mapping pointer to the file.
Prototype
1 | void *GmAlloc(size_t size) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
size |
Input |
Size of the shared memory to be allocated. |
Returns
Returns the start address of the shared memory space.
Constraints
This API generates a temporary file in the system /tmp directory. Therefore, the shared memory can be properly generated only when the drive space is sufficient.
Examples
1 2 | constexpr size_t len = 8 * 32 * 1024 * 8; half* x = (half*) GmAlloc(len*sizeof(half)); |