Skip to main content
Log in

Mojo function

buffer_load_lds

buffer_load_lds[type: DType](gds_ptr: UnsafePointer[SIMD[type, 1]], gds_offset: SIMD[int32, 1], lds_ptr_base: UnsafePointer[SIMD[type, 1], address_space=AddressSpace(3)], lds_offset: SIMD[int32, 1], num_records: Int)

Loads four bytes from global memory ands writes them to shared memory.

This function is used to copy from global memory to shared memory (aka LDS) bypassing storing to register.

Parameters:

  • type (DType): The type of the data to be loaded.

Args:

  • gds_ptr (UnsafePointer[SIMD[type, 1]]): Global memory base address.
  • gds_offset (SIMD[int32, 1]): Global memory offset.
  • lds_ptr_base (UnsafePointer[SIMD[type, 1], address_space=AddressSpace(3)]): LDS base address.
  • lds_offset (SIMD[int32, 1]): LDS offset.
  • num_records (Int): Reads with gds_offset > num_records return 0.