Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • pystencils pystencils
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 18
    • Issues 18
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pycodegen
  • pystencilspystencils
  • Issues
  • #62

Closed
Open
Created Jul 02, 2022 by Markus Holzer@holzerOwner

Wrong cast

This code:

import sympy as sp
import pystencils as ps


field_type = "float64" # if ctx.double_accuracy else "float32"
# ----- Solving the 2D Poisson equation with rhs --------------------------
dx = sp.Symbol("dx")
dy = sp.Symbol("dy")
src, dst, rhs = ps.fields(f"src, src_tmp, rhs: {field_type}[2D]", layout='fzyx')

up = ps.Assignment(src[0, 0], ((dy**2 * (src[1, 0] + src[-1, 0]))
                  + (dx**2 * (src[0, 1] + src[0, -1]))
                  - (rhs[0, 0] * dx**2 * dy**2)) / (2 * (dx**2 + dy**2)))
    
config = ps.CreateKernelConfig(data_type=field_type,
                               cpu_vectorize_info={'instruction_set': 'avx',
                                                   'assume_inner_stride_one': True,
                                                   'assume_aligned': True})
ast = ps.create_kernel(up, config=config)
ast.compile()

leads to NotImplementedError: Vectorizer cannot cast between different datatypes

Assignee
Assign to
Time tracking