Skip to content

Commit

Permalink
Renaming modules:
Browse files Browse the repository at this point in the history
- arrayfire to arrayfire_lib
- af_lib to arrayfire
  • Loading branch information
pavanky committed Dec 23, 2015
1 parent ac9cbd3 commit f7dda0a
Show file tree
Hide file tree
Showing 39 changed files with 43 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The wrapper is currently compliant with ArrayFire 3.2 API (and higher). If you f
## Example

```lua
local AF = require("af_lib")
local AF = require("arrayfire")

AF.main(function()
local x = AF.randu(5, "f32")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/benchmarks/blas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

-- create a small wrapper to benchmark
local A -- populated before each timing
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/benchmarks/fft.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

-- create a small wrapper to benchmark
local A -- populated before each timing
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/benchmarks/pi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local random = math.random
local sqrt = math.sqrt

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

-- generate millions of random samples
local samples = 20e6
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/financial/black_scholes_options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

-- Modules --
local input = require("financial.input")
local AF = require("af_lib")
local AF = require("arrayfire")

-- --
local sqrt2 = math.sqrt(2)
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/financial/heston_model.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ local exp = math.exp
local sqrt = math.sqrt

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

print("")
print("N.B. THIS IS A WIP")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/financial/monte_carlo_options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local exp = math.exp
local sqrt = math.sqrt

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

-- Shorthands --
local Comp, WC = AF.CompareResult, AF.WrapConstant
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/getting_started/convolve.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local lib = require("af_lib")
local lib = require("arrayfire")

lib.main(function()
-- 5x5 derivative with separable kernels
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/getting_started/integer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

print("")
print("N.B. THIS IS A WIP")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/getting_started/rainfall.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ print("")
-- note: example adapted from
-- "Rapid Problem Solving Using Thrust", Nathan Bell, NVIDIA
-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

-- Shorthands --
local Comp, WC = AF.CompareResult, AF.WrapConstant
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/graphics/conway.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

-- Shorthands --
local Comp, WC = AF.CompareResult, AF.WrapConstant
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/graphics/conway_pretty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

-- Shorthands --
local Comp, WC = AF.CompareResult, AF.WrapConstant
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/graphics/fractal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local abs = math.abs
local sqrt = math.sqrt

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

-- Shorthands --
local Comp, WC = AF.CompareResult, AF.WrapConstant
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/graphics/histogram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

AF.main(function()
local myWindow = AF.Window(512, 512, "Histogram example using ArrayFire")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/graphics/plot2d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
local pi = math.pi

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

--
local ITERATIONS = 100
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/graphics/plot3d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

local ITERATIONS = 200
local PRECISION = 1.0/ITERATIONS
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/graphics/surface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

print("")
print("N.B. THIS IS A WIP")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/helloworld/helloworld.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
--]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

AF.main(function()
print("Create a 5-by-3 matrix of random floats on the GPU")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/helloworld/intro.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
********************************************************/
--]]

local AF = require("af_lib")
local AF = require("arrayfire")

AF.main(function()
local x = AF.randu(5, "f32")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/lin_algebra/cholesky.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

AF.main(function()
local n = 5
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/lin_algebra/lu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

AF.main(function()
local in_arr = AF.randu(5, 8)
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/lin_algebra/qr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

AF.main(function()
print("Running QR InPlace")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/lin_algebra/svd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

print("")
print("N.B. THIS IS A WIP")
Expand Down
2 changes: 1 addition & 1 deletion examples/lua/pde/swe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local floor = math.floor

-- Modules --
local AF = require("af_lib")
local AF = require("arrayfire")

AF.main(function(argc, arv)
local win
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/funcs/io.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- IO functions.

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")
local array = require("impl.array")

-- Imports --
Expand Down
2 changes: 1 addition & 1 deletion lib/funcs/linear_algebra.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- Linear algebra functions.

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")
local array = require("impl.array")

-- Imports --
Expand Down
2 changes: 1 addition & 1 deletion lib/funcs/mathematics.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- Mathematics functions.

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")
local array = require("impl.array")

-- Imports --
Expand Down
2 changes: 1 addition & 1 deletion lib/funcs/signal_processing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
local min = math.min

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")
local array = require("impl.array")

-- Imports --
Expand Down
2 changes: 1 addition & 1 deletion lib/graphics/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local rawequal = rawequal
local type = type

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")
local array = require("impl.array")

-- Imports --
Expand Down
9 changes: 4 additions & 5 deletions lib/impl/array.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local traceback = debug and debug.traceback
local type = type

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")

-- Cached module references --
local _AddToCurrentEnvironment_
Expand Down Expand Up @@ -150,8 +150,7 @@ local Lib

--- DOCME
function M.GetLib ()
Lib = Lib or require("af_lib")

Lib = Lib or require("arrayfire")
return Lib
end

Expand Down Expand Up @@ -212,7 +211,7 @@ function M.ToArray (value, other)
local btype, hother = type(value), other:get()
local ndims = _Call_("af_get_numdims", hother)

Args[1], Args[2], Args[3], Args[4] = _Call_("af_get_dims", hother)
Args[1], Args[2], Args[3], Args[4] = _Call_("af_get_dims", hother)

if btype == "table" then
-- Complex...
Expand Down Expand Up @@ -330,4 +329,4 @@ _ToArray_ = M.ToArray
_WrapArray_ = M.WrapArray

-- Export the module.
return M
return M
2 changes: 1 addition & 1 deletion lib/impl/index.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- Core index module.

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")

-- Forward declarations --

Expand Down
2 changes: 1 addition & 1 deletion lib/impl/operators.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- Operator overloads.

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")

-- Forward declarations --
local CallWrap
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/constructors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local type = type
local unpack = unpack

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")
local array = require("impl.array")

-- Imports --
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/device.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- Device functions.

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")
local array = require("impl.array")

-- Imports --
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/methods.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- Array methods.

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")

-- Exports --
local M = {}
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/move_reorder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
local type = type

-- Modules --
local af = require("arrayfire")
local af = require("arrayfire_lib")
local array = require("impl.array")

-- Imports --
Expand Down
6 changes: 3 additions & 3 deletions src/Lua/arrayfire/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ ENDIF()
INCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})

ADD_LIBRARY(arrayfire SHARED
ADD_LIBRARY(arrayfire_lib SHARED
${src}
${funcs_src}
${graphics_src}
${methods_src})

TARGET_LINK_LIBRARIES(arrayfire
TARGET_LINK_LIBRARIES(arrayfire_lib
${ArrayFire_Unified_LIBRARIES}
${LUA_LIBRARIES}
)

SET_TARGET_PROPERTIES(arrayfire PROPERTIES
SET_TARGET_PROPERTIES(arrayfire_lib PROPERTIES
PREFIX "")
2 changes: 1 addition & 1 deletion src/Lua/arrayfire/arrayfire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void Register (lua_State * L, lua_CFunction func)
}
}

__EXPORT__ int luaopen_arrayfire (lua_State * L)
__EXPORT__ int luaopen_arrayfire_lib (lua_State * L)
{
lua_createtable(L, 0, 0); // af

Expand Down

0 comments on commit f7dda0a

Please sign in to comment.