Commit 1ea72d6f by Tianqi Chen Committed by GitHub

[DLPACK] Upgrade to the latest version (#150)

parent 050bc91b
Subproject commit 9f433c5ecfdd47184339cdd2b99706d24fae3aa1 Subproject commit a6e09b58dc00ee0065f5b7879800e646fbb01d1e
...@@ -26,8 +26,8 @@ cdef extern from "tvm/runtime/c_runtime_api.h": ...@@ -26,8 +26,8 @@ cdef extern from "tvm/runtime/c_runtime_api.h":
uint16_t lanes uint16_t lanes
ctypedef struct DLContext: ctypedef struct DLContext:
int device_id
int device_type int device_type
int device_id
ctypedef struct DLTensor: ctypedef struct DLTensor:
void* data void* data
......
...@@ -68,8 +68,8 @@ RPC_SESS_MASK = 128 ...@@ -68,8 +68,8 @@ RPC_SESS_MASK = 128
class TVMContext(ctypes.Structure): class TVMContext(ctypes.Structure):
"""TVM context strucure.""" """TVM context strucure."""
_fields_ = [("device_id", ctypes.c_int), _fields_ = [("device_type", ctypes.c_int),
("device_type", ctypes.c_int)] ("device_id", ctypes.c_int)]
MASK2STR = { MASK2STR = {
1 : 'cpu', 1 : 'cpu',
2 : 'gpu', 2 : 'gpu',
...@@ -88,8 +88,8 @@ class TVMContext(ctypes.Structure): ...@@ -88,8 +88,8 @@ class TVMContext(ctypes.Structure):
} }
def __init__(self, device_type, device_id): def __init__(self, device_type, device_id):
super(TVMContext, self).__init__() super(TVMContext, self).__init__()
self.device_id = device_id
self.device_type = device_type self.device_type = device_type
self.device_id = device_id
@property @property
def exist(self): def exist(self):
......
...@@ -361,11 +361,11 @@ llvm::Value* CodeGenLLVM::CreateStructRefPtr( ...@@ -361,11 +361,11 @@ llvm::Value* CodeGenLLVM::CreateStructRefPtr(
} }
case intrinsic::kArrDeviceId: { case intrinsic::kArrDeviceId: {
return builder_->CreateInBoundsGEP( return builder_->CreateInBoundsGEP(
buf, {index, ConstInt32(1), ConstInt32(0)}); buf, {index, ConstInt32(1), ConstInt32(1)});
} }
case intrinsic::kArrDeviceType: { case intrinsic::kArrDeviceType: {
return builder_->CreateInBoundsGEP( return builder_->CreateInBoundsGEP(
buf, {index, ConstInt32(1), ConstInt32(1)}); buf, {index, ConstInt32(1), ConstInt32(0)});
} }
case intrinsic::kTVMValueContent: { case intrinsic::kTVMValueContent: {
CHECK_EQ(t.lanes(), 1); CHECK_EQ(t.lanes(), 1);
......
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