Packages

class GpuScalar extends AutoCloseable

The wrapper of a Scala value and its corresponding cudf Scalar, along with its DataType.

This class is introduced because many expressions require both the cudf Scalar and its corresponding Scala value to complete their computations. e.g. 'GpuStringSplit', 'GpuStringLocate', 'GpuDivide', 'GpuDateAddInterval', 'GpuTimeMath' ... So only either a cudf Scalar or a Scala value can not support such cases, unless copying data between the host and the device each time being asked for.

This GpuScalar can be created from either a cudf Scalar or a Scala value. By initializing the cudf Scalar or the Scala value lazily and caching them after being created, it can reduce the unnecessary data copies.

If a GpuScalar is created from a Scala value and is used only on the host side, there will be no data copy and no cudf Scalar created. And if it is used on the device side, only need to copy data to the device once to create a cudf Scalar.

Similarly, if a GpuScalar is created from a cudf Scalar, no need to copy data to the host if it is used only on the device side (This is the ideal case we like, since all is on the GPU). And only need to copy the data to the host once if it is used on the host side.

So a GpuScalar will have at most one data copy but support all the cases. No round-trip happens.

Another reason why storing the Scala value in addition to the cudf Scalar is GpuDateAddInterval and 'GpuTimeMath' have different algorithms with the 3 members of a CalendarInterval, which can not be supported by a single cudf Scalar now.

Do not create a GpuScalar from the constructor, instead call the factory APIs above.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GpuScalar
  2. AutoCloseable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. def close(): Unit
    Definition Classes
    GpuScalar → AutoCloseable
  7. val dataType: DataType
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def getBase: Scalar

    Gets the internal cudf Scalar of this GpuScalar.

    Gets the internal cudf Scalar of this GpuScalar.

    This will not increase any reference count. So users need to close either the GpuScalar or the return cudf Scalar, not both.

  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def getValue: Any

    Gets the internal Scala value of this GpuScalar.

  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def incRefCount: GpuScalar.this.type

    Increment the reference count for this scalar.

    Increment the reference count for this scalar. You need to call close on this to decrement the reference count again.

  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def isNan: Boolean

    Whether the GpuScalar is Nan.

    Whether the GpuScalar is Nan. It works only for float and double types, otherwise an exception will be raised.

  18. def isNotNan: Boolean

    Whether the GpuScalar is not a Nan.

    Whether the GpuScalar is not a Nan. It works only for float and double types, otherwise an exception will be raised.

  19. def isValid: Boolean

    GpuScalar is valid when the Scala value is not null if it is defined, or the cudf Scalar is valid if the Scala value is not defined.

    GpuScalar is valid when the Scala value is not null if it is defined, or the cudf Scalar is valid if the Scala value is not defined. Because a cudf Scalar created from a null is invalid.

  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    GpuScalar → AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped