Skip to main content
Log in

Mojo function

async_copy

async_copy[type: DType, //, size: Int, *, fill: OptionalReg[SIMD[$0, 1]] = OptionalReg(None), bypass_L1_16B: Bool = True, l2_prefetch: OptionalReg[Int] = OptionalReg(None), eviction_policy: CacheEviction = 0](src: UnsafePointer[SIMD[type, 1], address_space=1], dst: UnsafePointer[SIMD[type, 1], address_space=3], src_size: SIMD[int32, 1] = SIMD(0), predicate: Bool = False)

Asynchronously copy size amount of bytes from src global memory address to shared memory dst address.

Parameters:

  • type (DType): The pointer type.
  • size (Int): Number of bytes to copy.
  • fill (OptionalReg[SIMD[$0, 1]]): The fill to use for initializing the data.
  • bypass_L1_16B (Bool): Bypass the L1 cache for 16 bypes copy.
  • l2_prefetch (OptionalReg[Int]): Enable L2 prefetching and specify the size.
  • eviction_policy (CacheEviction): Specifies the eviction policy to use.

Args:

  • src (UnsafePointer[SIMD[type, 1], address_space=1]): Global memory pointer.
  • dst (UnsafePointer[SIMD[type, 1], address_space=3]): Shared memory pointer.
  • src_size (SIMD[int32, 1]): The size of data actually copied. When src_size < size, the rest is set to zero by the instruction.
  • predicate (Bool): Specifies the predicate used for async_copy.