Skip to content

Commit ad3b7bb

Browse files
Prerak SinghPrerak Singh
authored andcommitted
bug fix
1 parent 7590e68 commit ad3b7bb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pydatastructs/graphs/_backend/cpp/llvm_adjacency_list.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import llvmlite.binding as llvm
22
import llvmlite.ir as ir
33
from llvmlite import ir
4+
import platform
45
import ctypes
56
from ctypes import Structure, POINTER, c_void_p, c_int, c_char_p, c_double
67

@@ -35,6 +36,10 @@ def __init__(self):
3536
self._create_function_declarations()
3637

3738
self._create_graph_functions()
39+
if platform.system().lower() == "linux":
40+
self.module.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
41+
else:
42+
self.module.data_layout = str(self.target_data)
3843

3944
def _get_target_triple(self):
4045
import platform

pydatastructs/graphs/tests/test_adjacency_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_adjacency_list():
8484

8585
g3 = Graph('a','b',implementation = 'adjacency_list', backend = Backend.LLVM)
8686
g3.add_edge('a', 'b')
87-
#assert g3.is_adjacent('a','b') is True
87+
assert g3.is_adjacent('a','b') is True
8888
g3.add_vertex('c')
8989
g3.add_edge('a','c')
9090
assert g3.is_adjacent('a','c') is True

0 commit comments

Comments
 (0)