Commit c8df384c authored by yan.yan's avatar yan.yan
Browse files

fix a small build bug

parent 027b9655
...@@ -21,6 +21,12 @@ from cumm.common import (TensorView, TensorViewCPU, TensorViewHashKernel, ...@@ -21,6 +21,12 @@ from cumm.common import (TensorView, TensorViewCPU, TensorViewHashKernel,
TensorViewKernel, TslRobinMap) TensorViewKernel, TslRobinMap)
from spconv.csrc.sparse.cpu_core import OMPLib from spconv.csrc.sparse.cpu_core import OMPLib
if CUMM_CPU_ONLY_BUILD:
_member_func = pccm.member_function
else:
_member_func = pccm.cuda.member_function
class HashTable(pccm.Class, pccm.pybind.PybindClassMixin): class HashTable(pccm.Class, pccm.pybind.PybindClassMixin):
"""a simple hashtable for both cpu and cuda. """a simple hashtable for both cpu and cuda.
CPU implementation don't support parallel. CPU implementation don't support parallel.
...@@ -79,7 +85,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin): ...@@ -79,7 +85,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin):
return code return code
@pccm.pybind.mark @pccm.pybind.mark
@pccm.cuda.member_function @_member_func
def clear(self): def clear(self):
""" in this function, if values is empty, it will be assigned to zero. """ in this function, if values is empty, it will be assigned to zero.
""" """
...@@ -123,7 +129,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin): ...@@ -123,7 +129,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin):
@pccm.pybind.mark @pccm.pybind.mark
@pccm.cuda.member_function @_member_func
def insert(self): def insert(self):
""" in this function, if values is empty, it will be assigned to zero. """ in this function, if values is empty, it will be assigned to zero.
""" """
...@@ -195,7 +201,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin): ...@@ -195,7 +201,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin):
return code return code
@pccm.pybind.mark @pccm.pybind.mark
@pccm.cuda.member_function @_member_func
def query(self): def query(self):
"""query keys, save to values, and save is_empty to is_empty """query keys, save to values, and save is_empty to is_empty
""" """
...@@ -267,7 +273,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin): ...@@ -267,7 +273,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin):
return code return code
@pccm.pybind.mark @pccm.pybind.mark
@pccm.cuda.member_function @_member_func
def assign_arange_(self): def assign_arange_(self):
""" this function assign "arange(NumItem)" to table values. """ this function assign "arange(NumItem)" to table values.
useful in "unique-like" operations. useful in "unique-like" operations.
...@@ -322,7 +328,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin): ...@@ -322,7 +328,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin):
return code return code
@pccm.pybind.mark @pccm.pybind.mark
@pccm.cuda.member_function @_member_func
def size_cpu(self): def size_cpu(self):
""" this function can only be used to get cpu hash table size. """ this function can only be used to get cpu hash table size.
""" """
...@@ -342,7 +348,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin): ...@@ -342,7 +348,7 @@ class HashTable(pccm.Class, pccm.pybind.PybindClassMixin):
@pccm.pybind.mark @pccm.pybind.mark
@pccm.cuda.member_function @_member_func
def items(self): def items(self):
"""get items. """get items.
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment