Skip to content

PIM API

Farzana Ahmed Siddique edited this page Sep 16, 2024 · 3 revisions

Overview

PIMeval provides a single public header for PIM benchmark application development, locating at libpimeval/src/libpimeval.h. Details of data types and APIs of this header are described in this wiki page.

(more details to be added)

Data Structure

  • PimObjId
    • An integer value represents an allocated PIM object.
  • PimDeviceEnum
    • PIM architecture.
  • PimAllocEnum
    • PIM allocation strategy.
    • PIM_ALLOC_AUTO: Recommended way which can automatically determine V or H data layouts based on functional simulation target.
  • PimDataType
    • PIM object element data type required for allocating a PIM object.
  • PimCopyEnum
    • Data copy strategy.
  • PimDeviceProperties
    • PIM device properties.

APIs

PIM Device Management

  • pimCreateDevice
    • Create a PIM device of a specific PIM device type to start simulation.
    • Use PIM_FUNCTIONAL for functional simulation, so that a PIM benchmark can work for multiple PIM simulation targets.
    • Use specific PIM device type for micro-ops level simulation.
  • pimCreateDeviceFromConfig
    • Read PIMeval and device parameters from a config file.
    • Alternatively, config file can be specified through environment variables.
      • PIMEVAL_TARGET
      • PIMEVAL_CONFIG_PATH
      • PIMEVAL_CONFIG_SIM
  • pimGetDeviceProperties
    • Get PIM device properties.
  • pimDeleteDevice
    • Delete PIM device and end simulation.

PIM Data Object Management

  • pimAlloc
    • Allocate a new PIM data object.
  • pimAllocAssociated
    • Allocate a new PIM data object associated with an existing PIM object.
    • Associated PIM objects have same number of elements, and element indices are aligned during allocation.
  • pimFree
    • Delete a PIM object and free the memory space.

Data Transfer

  • pimCopyHostToDevice
    • Copy data from CPU memory space to PIM memory space.
  • pimCopyDeviceToHost
    • Copy data from PIM memory space to CPU memory space.
  • pimCopyDeviceToDevice
    • COpy data between two associated PIM objects.

PIM Computation

Arithmetic

  • pimAdd
  • pimSub
  • pimMul
  • pimDiv
  • pimAbs
  • pimMin
  • pimMax
  • pimAddScalar
  • pimSubScalar
  • pimMulScalar
  • pimDivScalar
  • pimAbsScalar
  • pimMinScalar
  • pimMaxScalar

Bitwise

  • pimAnd
  • pimOr
  • pimXor
  • pimXnor
  • pimAndScalar
  • pimOrScalar
  • pimXorScalar
  • pimXnorScalar
  • pimShiftBitsRight
  • pimShiftBitsLeft
  • pimPopCount

Relational

  • pimGT
  • pimLT
  • pimEQ
  • pimGTScalar
  • pimLTScalar
  • pimEQScalar

Reduction sum

  • pimRedSumInt
  • pimRedSumUInt
  • pimRedSumRangedInt
  • pimRedSumRangedUInt

Broadcast

  • pimBroadcastInt
  • pimBroadcastUInt

Element-wise shift/rotate

  • pimRotateElementsRight
  • pimRotateElementsLeft
  • pimShiftElementsRight
  • pimShiftElementsLeft

Micro-ops Simulation APIs

To be added.

Clone this wiki locally