Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Chameleon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Operate
Environments
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
Chameleon
Commits
ab60b21a
Commit
ab60b21a
authored
1 year ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
coreblas: add ipiv_to_perm kernel
parent
c9f51bcb
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!404
GETRF: add panel permutation to get a full partial pivoting available
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
coreblas/compute/CMakeLists.txt
+6
-5
6 additions, 5 deletions
coreblas/compute/CMakeLists.txt
coreblas/compute/core_ipiv_to_perm.c
+97
-0
97 additions, 0 deletions
coreblas/compute/core_ipiv_to_perm.c
coreblas/include/coreblas.h
+4
-2
4 additions, 2 deletions
coreblas/include/coreblas.h
with
107 additions
and
7 deletions
coreblas/compute/CMakeLists.txt
+
6
−
5
View file @
ab60b21a
...
@@ -17,14 +17,14 @@
...
@@ -17,14 +17,14 @@
# Univ. of California Berkeley,
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
# Univ. of Colorado Denver.
#
#
# @version 1.
2
.0
# @version 1.
3
.0
# @author Cedric Castagnede
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Mathieu Faverge
# @author Florent Pruvost
# @author Florent Pruvost
# @author Guillaume Sylvand
# @author Guillaume Sylvand
# @author Matthieu Kuhn
# @author Matthieu Kuhn
# @date 202
2
-0
2-22
# @date 202
3
-0
8-31
#
#
###
###
...
@@ -132,9 +132,10 @@ precisions_rules_py(COREBLAS_SRCS_GENERATED "${ZSRC}"
...
@@ -132,9 +132,10 @@ precisions_rules_py(COREBLAS_SRCS_GENERATED "${ZSRC}"
PRECISIONS
"
${
CHAMELEON_PRECISION
}
"
)
PRECISIONS
"
${
CHAMELEON_PRECISION
}
"
)
set
(
COREBLAS_SRCS
set
(
COREBLAS_SRCS
global.c
global.c
${
COREBLAS_SRCS_GENERATED
}
core_ipiv_to_perm.c
)
${
COREBLAS_SRCS_GENERATED
}
)
# Force generation of sources
# Force generation of sources
# ---------------------------
# ---------------------------
...
...
This diff is collapsed.
Click to expand it.
coreblas/compute/core_ipiv_to_perm.c
0 → 100644
+
97
−
0
View file @
ab60b21a
/**
*
* @file core_ipiv_to_perm.c
*
* @copyright 2023-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
*
* @brief Chameleon core_ipiv_to_perm CPU kernel
*
* @version 1.3.0
* @author Mathieu Faverge
* @date 2023-08-31
*/
#include
"coreblas.h"
/**
*******************************************************************************
*
* The idea here is to generate a permutation from the sequence of
* pivot. To avoid storing one whole column at each step, we keep
* track of two vectors of nb elements, the first one contains the
* permutation of the first nb elements, and the second one contains
* the inverse permutation of those same elements.
*
* Lets have i the element to pivot with ip. ipiv[i] = ip;
* We set i_1 as such invp[ i_1 ] = i
* and ip_1 as such invp[ ip_1 ] = ip
*
* At each step we want to:
* - swap perm[i] and perm[ip]
* - set invp[i_1] to ip
* - set invp[ip_1] to i
*
*******************************************************************************
*
* @param[in] m0
* The base index for all values in ipiv, perm and invp. m0 >= 0.
*
* @param[in] m
* The number of elements in perm and invp. m >= 0.
*
* @param[in] k
* The number of elements in ipiv. k >= 0.
*
* @param[in] ipiv
* The pivot array of size n. This is a (m0+1)-based indices array to follow
* the Fortran standard.
*
* @param[out] perm
* The permutation array of the destination row indices (m0-based) of the [1,n] set of rows.
*
* @param[out] invp
* The permutation array of the origin row indices (m0-based) of the [1,n] set of rows.
*
*/
void
CORE_ipiv_to_perm
(
int
m0
,
int
m
,
int
k
,
int
*
ipiv
,
int
*
perm
,
int
*
invp
)
{
int
i
,
j
,
ip
;
int
i_1
,
ip_1
;
for
(
i
=
0
;
i
<
m
;
i
++
)
{
perm
[
i
]
=
i
+
m0
;
invp
[
i
]
=
i
+
m0
;
}
for
(
i
=
0
;
i
<
k
;
i
++
)
{
ip
=
ipiv
[
i
]
-
1
;
assert
(
ip
-
m0
>=
i
);
if
(
ip
-
m0
>
i
)
{
i_1
=
perm
[
i
];
if
(
ip
-
m0
<
m
)
{
ip_1
=
perm
[
ip
-
m0
];
perm
[
ip
-
m0
]
=
i_1
;
}
else
{
ip_1
=
ip
;
for
(
j
=
0
;
j
<
m
;
j
++
)
{
if
(
invp
[
j
]
==
ip
)
{
ip_1
=
j
+
m0
;
break
;
}
}
}
perm
[
i
]
=
ip_1
;
i_1
-=
m0
;
ip_1
-=
m0
;
if
(
i_1
<
m
)
invp
[
i_1
]
=
ip
;
if
(
ip_1
<
m
)
invp
[
ip_1
]
=
i
+
m0
;
}
}
}
This diff is collapsed.
Click to expand it.
coreblas/include/coreblas.h
+
4
−
2
View file @
ab60b21a
...
@@ -11,14 +11,14 @@
...
@@ -11,14 +11,14 @@
*
*
* @brief Chameleon CPU kernels main header
* @brief Chameleon CPU kernels main header
*
*
* @version 1.
2
.0
* @version 1.
3
.0
* @author Jakub Kurzak
* @author Jakub Kurzak
* @author Hatem Ltaief
* @author Hatem Ltaief
* @author Florent Pruvost
* @author Florent Pruvost
* @author Guillaume Sylvand
* @author Guillaume Sylvand
* @author Mathieu Faverge
* @author Mathieu Faverge
* @author Raphael Boucherie
* @author Raphael Boucherie
* @date 202
2
-0
2-22
* @date 202
3
-0
8-31
*
*
*/
*/
#ifndef _coreblas_h_
#ifndef _coreblas_h_
...
@@ -87,6 +87,8 @@ void __coreblas_kernel_trace( const char *func, ... );
...
@@ -87,6 +87,8 @@ void __coreblas_kernel_trace( const char *func, ... );
#endif
#endif
void
CORE_ipiv_to_perm
(
int
m0
,
int
m
,
int
k
,
int
*
ipiv
,
int
*
perm
,
int
*
invp
);
END_C_DECLS
END_C_DECLS
#endif
/* _coreblas_h_ */
#endif
/* _coreblas_h_ */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment